Comment: Comment: PSMSuite 7 Setup Project
Comment: Set Variable VAR to English$NEWLINE$French$NEWLINE$Spanish$NEWLINE$Italian$NEWLINE$German
Comment: Set Variable SELECTEDLANGUAGE to 
Set Variable OSLANGUE to 
Get System Setting Internet Explorer 5.0 into CHECKSYSTEM
Get System Setting Language (Numeric) into OSLANGUE
Set Variable ALLUSERS to TRUE
Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\$STARTMENU$
Comment: Check the O.S. language and setted the codepage
if Variable OSLANGUE Equals 2052
  Set Variable OSCODEPAGE to 936
end
if Variable OSLANGUE Equals 1028
  Set Variable OSCODEPAGE to 950
end
if Variable OSLANGUE Equals 1042
  Set Variable OSCODEPAGE to 949
end
if Variable OSLANGUE Equals 1041
  Set Variable OSCODEPAGE to 932
end
if Variable OSLANGUE Equals 1043
  Set Variable OSCODEPAGE to 1252
end
if Variable OSLANGUE Equals 1031
  Set Variable OSCODEPAGE to 1252
end
if Variable OSLANGUE Equals 1034
  Set Variable OSCODEPAGE to 1252
end
if Variable OSLANGUE Equals 1036
  Set Variable OSCODEPAGE to 1252
end
if Variable OSLANGUE Equals 1040
  Set Variable OSCODEPAGE to 1252
end
if Variable OSLANGUE Equals 1049
  Set Variable OSCODEPAGE to 1251
end
if Variable OSLANGUE Equals 1055
  Set Variable OSCODEPAGE to 1254
end
if Variable OSLANGUE Equals 2070
  Set Variable OSCODEPAGE to 1252
end
if Variable OSLANGUE Equals 1033
  Set Variable OSCODEPAGE to 1252
end
 
[DEFINE REGION: Check Application Requirements]
Get System Setting Internet Explorer 5.5 Service Pack 2 into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Internet Explorer 6.0 Service Pack 1.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
Get System Setting Internet Explorer 5.0 into CHECKSYSTEM
Get System Setting Language (Numeric) into OSLANGUE
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Internet Explorer 5.0.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
Get System Setting Windows 2000 into CHECKSYSTEM
if Variable CHECKSYSTEM not Equals TRUE
  MessageBox: $TITLE$ Setup Error, This product requires at least Windows 2000.$NEWLINE$$NEWLINE$Setup cannot continue.
  Terminate Installation
end
[END REGION]
 
[DEFINE REGION: Check/Install Application Pre-Requisites]
 
[DEFINE REGION: Check Application Pre-Requisites]
Set Variable CURRENTPRODUCTCODE to $PRODUCTCODE$
Set Variable WINDIR to 
Set Variable OTHERWINDIR to 
Get Common Folder Location System->Windows Directory into WINDIR
Get Common Folder Location System->System Directory into WINSYSDIR
Set Variable TEMPDIR to 
Get Environment Variable %TEMP% into Variable TEMPDIR
Get Common Folder Location System->Program Files Directory into COMMONFILES
Set Variable PART1 to 
Set Variable PART2 to 
Set Variable PART3 to 
Set Variable PART4 to 
Set Variable PART5 to 
Set Variable L1 to 
Set Variable L2 to 
Set Variable L3 to 
Set Variable L4 to 
Set Variable L5 to 
Set Variable L6 to 
Set Variable L7 to 
Set Variable L8 to 
Set Variable L9 to 
Set Variable L10 to 
Set Variable L11 to 
Set Variable L12 to 
Set Variable MODIFIEDPART1 to 
Parse String $CURRENTPRODUCTCODE$ into Variables  and MODIFIEDPRODUCTCODE (Split at first occurrence of pattern)
Parse String $MODIFIEDPRODUCTCODE$ into Variables MODIFIEDPRODUCTCODE and  (Split at first occurrence of pattern)
Parse String $MODIFIEDPRODUCTCODE$ into Variables PART1 and MODIFIEDPRODUCTCODE (Split at first occurrence of pattern)
Parse String $MODIFIEDPRODUCTCODE$ into Variables PART2 and MODIFIEDPRODUCTCODE (Split at first occurrence of pattern)
Parse String $MODIFIEDPRODUCTCODE$ into Variables PART3 and MODIFIEDPRODUCTCODE (Split at first occurrence of pattern)
Parse String $MODIFIEDPRODUCTCODE$ into Variables PART4 and MODIFIEDPRODUCTCODE (Split at first occurrence of pattern)
Parse String $MODIFIEDPRODUCTCODE$ into Variables PART5 and MODIFIEDPRODUCTCODE (Split at first occurrence of pattern)
Comment: Reverse the first occurence of Product Code
Parse String $PART1$ into Variables PART1 and L1 (Split at position from start)
Parse String $PART1$ into Variables PART1 and L2 (Split at position from start)
Parse String $PART1$ into Variables PART1 and L3 (Split at position from start)
Parse String $PART1$ into Variables PART1 and L4 (Split at position from start)
Parse String $PART1$ into Variables PART1 and L5 (Split at position from start)
Parse String $PART1$ into Variables PART1 and L6 (Split at position from start)
Parse String $PART1$ into Variables PART1 and L7 (Split at position from start)
Set Variable MODIFIEDPART1 to $L1$$L2$$L3$$L4$$L5$$L6$$L7$$PART1$
Comment: Reverse the 2nd occurence of Product Code
Parse String $PART2$ into Variables PART2 and L1 (Split at position from start)
Parse String $PART2$ into Variables PART2 and L2 (Split at position from start)
Parse String $PART2$ into Variables PART2 and L3 (Split at position from start)
Set Variable MODIFIEDPART2 to $L1$$L2$$L3$$PART2$
Comment: Reverse the 3RD occurence of Product Code
Parse String $PART3$ into Variables PART3 and L1 (Split at position from start)
Parse String $PART3$ into Variables PART3 and L2 (Split at position from start)
Parse String $PART3$ into Variables PART3 and L3 (Split at position from start)
Set Variable MODIFIEDPART3 to $L1$$L2$$L3$$PART3$
Comment: Reverse the 4th occurence of Product Code
Parse String $PART4$ into Variables PART4 and L1 (Split at position from start)
Parse String $PART4$ into Variables PART4 and L2 (Split at position from start)
Parse String $PART4$ into Variables PART4 and L3 (Split at position from start)
Set Variable MODIFIEDPART4 to $L3$$PART4$$L1$$L2$
Comment: Reverse the last occurence of Product Code
Parse String $PART5$ into Variables PART5 and L1 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L2 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L3 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L4 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L5 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L6 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L7 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L8 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L9 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L10 (Split at position from start)
Parse String $PART5$ into Variables PART5 and L11 (Split at position from start)
Set Variable MODIFIEDPART5 to $L11$$PART5$$L9$$L10$$L7$$L8$$L5$$L6$$L3$$L4$$L1$$L2$
Comment: Put it all together
Set Variable SECRETPRODUCTCODE to $MODIFIEDPART1$$MODIFIEDPART2$$MODIFIEDPART3$$MODIFIEDPART4$$MODIFIEDPART5$
Comment: Check setup pre-requisites
Set Variable X64DETECTED to 
Get System Setting Windows in 64 bit Mode into X64DETECTED
Set Variable WEBLINK to http://updates.ca.objectiflune.com/Test/
Set Variable PREREQ to FALSE
Set Variable PRELIST to 
Set Variable PSSWORD to 
Set Variable PSSUSER to 
Set Variable PSSDOMAIN to 
Set Variable PSSRESULT to 
Set Variable APACHEHTTPPORTNUMBER to 
Set Variable PSW to FALSE
Set Variable PSW2 to 
Set Variable FREEORNOT to TRUE
Set Variable PSM to TRUE
Set Variable BARCOD to TRUE
Set Variable DSM to TRUE
Set Variable OLAP to TRUE
Set Variable APACH to 
Set Variable BINDCHECKBOX to 
Set Variable HTTPSCHECKBOXVALUE to 
Set Variable MYSQL to 
Get System Setting Logged on User Name into PSSUSER
Set Variable APACHEHTTPSPORTNUMBER to 443
Set Variable HTTPORTVALUE to 80
Set Variable RUNAPP to False
Set Variable MODIFY to TRUE
Set Variable REPAIR to FALSE
Set Variable ISWINDOWS64BIT to FALSE
Set Variable ISWIN2K to FALSE
Set Variable ISVISTA to 
Set Variable ISWIN2008 to 
Get Exact OS Level into ISWIN2008
Get Exact OS Level into ISVISTA
Get System Setting Logged on Domain Name into PSSDOMAIN
Get System Setting Windows in 64 bit Mode into ISWINDOWS64BIT
Get System Setting Windows 2000 into ISWIN2K
Set Variable ISWIN2KOS to 
Set Variable PSWEXIST to 
Set Variable PSWPRODUCTCODE to 
Set Variable KEYVALUE to 
Set Variable MYDRIVE to 
Set Variable QUOTE to "
Set Variable ISINSTALLED to 
Get Installed State for $PRODUCTCODE$ into Variable ISINSTALLED
Set Variable LICENSETEXT to 
Get Environment Variable %SystemDrive% into Variable MYDRIVE
Comment: Variable which trigger the uninstall process
Set Variable EXECUTEUNINSTALL to FALSE
Comment: Does Folder Exist $TARGETDIR$\PrintShop Mail Web (get result into variable PSWEXIST)
Get Exact OS Level into ISWIN2KOS
Comment: Check PSW 2.0.0
Comment: Get the current date and create an appropriate date format
Set Variable NUMBER to 10
Set Variable MONTH to 
Set Variable DAY to 
Set Variable TEMP_DATE to 
Parse String $DATE$ into Variables MONTH and TEMP_DATE (Split at first occurrence of pattern)
Parse String $TEMP_DATE$ into Variables DAY and TEMP_DATE (Split at first occurrence of pattern)
Parse String $TEMP_DATE$ into Variables YEAR and TEMP_DATE (Split at first occurrence of pattern)
Set Variable COMPARERESULT to 
Set Variable DONGLE1 to 
Set Variable DONGLE2 to 
Set Variable DONGLE3 to 
Evaluate Expression $MONTH$ > $NUMBER$ into variable COMPARERESULT
if Variable COMPARERESULT Equals TRUE
  Set Variable MONTH to 0$MONTH$
end
Set Variable MYDATEFORMAT to $YEAR$$MONTH$
Comment: GET the TIME for the backup files
Set Variable HOUR to 
Set Variable MINUTE to 
Set Variable VAR to 
Parse String $TIME$ into Variables HOUR and VAR (Split at first occurrence of pattern)
Parse String $VAR$ into Variables MINUTE and  (Split at first occurrence of pattern)
Comment: GET the cmdline parameters variable
if Variable CMDLINE Contains (Ignore Case) /s
  Set Variable SILENT to TRUE
  Comment: if Variable SILENT Equals TRUE
  Set Variable COMMANDLINE to $CMDLINE$
  Set Variable SILENT  to TRUE
  if Variable COMMANDLINE Contains (Ignore Case) PASSWORD=
    Set Variable MYPASSWORD to 
    Parse String $COMMANDLINE$ into Variables  and WORD (Split at first occurrence of pattern)
    Parse String $WORD$ into Variables MYPASSWORD and  (Split at first occurrence of pattern)
    Set Variable PSSWORD to $MYPASSWORD$
  end
  if Variable COMMANDLINE Contains (Ignore Case) PRINTSHOPWEB=0
    Set Variable PSW to FALSE
  else
    if Variable COMMANDLINE Contains (Ignore Case) PRINTSHOPWEB=1
      Set Variable PSW to TRUE
    end
  end
  if Variable COMMANDLINE Contains (Ignore Case) BARCODEPLUGIN=0
    Set Variable BARCOD to FALSE
  else
    Set Variable BARCOD to TRUE
  end
  if Variable COMMANDLINE Contains (Ignore Case) OLAPLUGIN=0
    Set Variable OLAP to FALSE
  else
    Set Variable OLAP to TRUE
  end
  if Variable COMMANDLINE Contains (Ignore Case) DSMPLUGIN=0
    Set Variable DSM to FALSE
  else
    Set Variable DSM to TRUE
  end
  if Variable COMMANDLINE Contains (Ignore Case) APACHEHTTPSPORTNUMBER=
    Set Variable HTTPSCHECKBOXVALUE to TRUE
  else
    Set Variable HTTPSCHECKBOXVALUE to FALSE
  end
  if Variable COMMANDLINE Contains (Ignore Case) BIND=0
    Set Variable BINDCHECKBOX to FALSE
  else
    Set Variable BINDCHECKBOX to TRUE
  end
end
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A524002C-7045-4557-805D-90DF5A5BA608}\InstallLocation into KEYVALUE
if Variable KEYVALUE not Equals NO$KEY
  Set Variable PSWPRODUCTCODE to {A524002C-7045-4557-805D-90DF5A5BA608}
  Get Installed State for $PSWPRODUCTCODE$ into Variable PSW2
  Set Variable OLDPSW to 
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A524002C-7045-4557-805D-90DF5A5BA608}\InstallLocation into OLDPSW
  Set Persistent Variable OLDPSWPATH to $OLDPSW$
  Set Persistent Variable OLDDATABASEFOLDER to $OLDPSWPATH$MySQL\data\psw
  Set Variable OLDDATABASEFOLDEREXIST to 
  Does Folder Exist $OLDDATABASEFOLDER$ (get result into variable OLDDATABASEFOLDEREXIST)
end
Comment: Check PSW 2.0.1
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2638897924-2036029664-1161237532-500\Products\C200425A5407755408D509FDA5B56A80\InstallProperties\InstallLocation into KEYVALUE
if Variable KEYVALUE not Equals NO$KEY
  Set Variable PSWPRODUCTCODE to {A524002C-7045-4557-805D-90DF5A5BA608}
  Get Installed State for $PSWPRODUCTCODE$ into Variable PSW2
  Set Variable OLDPSW to 
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-2638897924-2036029664-1161237532-500\Products\C200425A5407755408D509FDA5B56A80\InstallProperties\InstallLocation into OLDPSW
  Write into Text File $TEMPDIR$\PSWBACKUPPATH.txt from Value $OLDPSW$ (at start of file)
  Set Persistent Variable OLDPSWPATH to $OLDPSW$
  Set Persistent Variable OLDDATABASEFOLDER to $OLDPSWPATH$MySQL\data\psw
  Set Variable OLDDATABASEFOLDEREXIST to 
  Does Folder Exist $OLDDATABASEFOLDER$ (get result into variable OLDDATABASEFOLDEREXIST)
end
Comment: Check PSW 2.1.0
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0406F202-51CF-4284-936F-006B454C6C0C}\InstallLocation into KEYVALUE
if Variable KEYVALUE not Equals NO$KEY
  Set Variable PSWPRODUCTCODE to {0406F202-51CF-4284-936F-006B454C6C0C}
  Get Installed State for $PSWPRODUCTCODE$ into Variable PSW2
  Set Variable OLDPSW to 
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0406F202-51CF-4284-936F-006B454C6C0C}\InstallLocation into OLDPSW
  Write into Text File $TEMPDIR$\PSWBACKUPPATH.txt from Value $OLDPSW$ (at start of file)
  Set Persistent Variable OLDPSWPATH to $OLDPSW$
  Set Persistent Variable OLDDATABASEFOLDER to $OLDPSWPATH$MySQL\data\psw
  Set Variable OLDDATABASEFOLDEREXIST to 
  Does Folder Exist $OLDDATABASEFOLDER$ (get result into variable OLDDATABASEFOLDEREXIST)
end
Comment: Check PSW 2.2.0
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{60D966C9-1905-4328-A383-B883A7BEEB5B}\InstallLocation into KEYVALUE
if Variable KEYVALUE not Equals NO$KEY
  Set Variable PSWPRODUCTCODE to {60D966C9-1905-4328-A383-B883A7BEEB5B}
  Get Installed State for $PSWPRODUCTCODE$ into Variable PSW2
  Set Variable OLDPSW to 
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{60D966C9-1905-4328-A383-B883A7BEEB5B}\InstallLocation into OLDPSW
  Write into Text File $TEMPDIR$\PSWBACKUPPATH.txt from Value $OLDPSW$ (at start of file)
  Set Persistent Variable OLDPSWPATH to $OLDPSW$
  Set Persistent Variable OLDDATABASEFOLDER to $OLDPSWPATH$MySQL\data\psw
  Set Variable OLDDATABASEFOLDEREXIST to 
  Does Folder Exist $OLDDATABASEFOLDER$ (get result into variable OLDDATABASEFOLDEREXIST)
end
Comment: Check PSW 2.2.1
Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5A9F1F87-6D53-4028-8F6A-BCA9BF1CE0DF}\InstallLocation into KEYVALUE
if Variable KEYVALUE not Equals NO$KEY
  Set Variable PSWPRODUCTCODE to {5A9F1F87-6D53-4028-8F6A-BCA9BF1CE0DF}
  Get Installed State for $PSWPRODUCTCODE$ into Variable PSW2
  Set Variable OLDPSW to 
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5A9F1F87-6D53-4028-8F6A-BCA9BF1CE0DF}\InstallLocation into OLDPSW
  Write into Text File $TEMPDIR$\PSWBACKUPPATH.txt from Value $OLDPSW$ (at start of file)
  Set Persistent Variable OLDPSWPATH to $OLDPSW$
  Set Persistent Variable OLDDATABASEFOLDER to $OLDPSWPATH$MySQL\data\psw
  Set Variable OLDDATABASEFOLDEREXIST to 
  Does Folder Exist $OLDDATABASEFOLDER$ (get result into variable OLDDATABASEFOLDEREXIST)
end
Comment: Detection to avoid Downgrade
Set Variable INSTALLEDVERSION to 
Set Variable CURRENTVERSION to #IAVERSIONNUMBER#
Set Variable VERSIONDOWNGRADECOMPARE to 
Check Registry Key HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCTCODE$\DisplayVersion into INSTALLEDVERSION
Evaluate Expression $INSTALLEDVERSION$ > $CURRENTVERSION$ into variable VERSIONDOWNGRADECOMPARE
if Variable INSTALLEDVERSION Greater Than (Version) $CURRENTVERSION$
  MessageBox: $TITLE$, The currently installed program version is higher than the one you are trying to install.The installation cannot continue, please go to http://www.objectiflune.com to get the latest release available or use the update manager software.
  Terminate Installation
end
[compiler if Variable BUILDMODE not Equals PATCH]
if Variable NEEDSUPGRADE Equals TRUE
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$Previous Version Uninstallation
end
Set Variable PROJECTDATE to #OPTION_BUILDDATE#
Comment: Customize the date for the warnig msg
Set Variable YEARDATE to 
Set Variable MONTHDATE to 
Parse String $PROJECTDATE$ into Variables YEARDATE and MONTHDATE (Split at position from start)
Comment: Parse String $TEMP_DATE$ into Variables DAY and TEMP_DATE (Split at first occurrence of pattern)
Comment: Parse String $TEMP_DATE$ into Variables YEAR and TEMP_DATE (Split at first occurrence of pattern)
if Variable PSW2 Equals TRUE
  Comment: check the dongle to compare the date
  Set Variable DONGLEINFO to 
  Check Registry Key HKCU\Software\PrintShop Mail\Dongle Info\ into DONGLEINFO
  if Variable DONGLEINFO not Equals NO$KEY
    Set Variable PSMACTIVATIONRESULT to 
    PSMActivation plug-in :  get result into variable PSMACTIVATIONRESULT
    Parse String $PSMACTIVATIONRESULT$ into Variables DONGLE1 and PSMACTIVATIONRESULT (Split at first occurrence of pattern)
    Parse String $PSMACTIVATIONRESULT$ into Variables DONGLE2 and PSMACTIVATIONRESULT (Split at first occurrence of pattern)
    if Variable PSMACTIVATIONRESULT not Equals ERROR
      Comment: Set Variable PROJECTDATE to #OPTION_BUILDDATE#
      Comment: if Variable DONGLE2 not Greater Than MYDATEFORMAT
      Set Variable DONGLEYEAR to 
      Set Variable DONGLENONTH to 
      Parse String $DONGLE2$ into Variables DONGLEYEAR and DONGLEMONTH (Split at position from start)
      if Variable DONGLE2 not Greater Than PROJECTDATE
        MessageBox: $TITLE$, Your dongle reports a final care date of $DONGLEMONTH$-$DONGLEYEAR$. Please be aware that both PrintShop Mail and PrintShop Mail Web will be limited until you upgrade your license.
      else
        MessageBox: $TITLE$, In order to access the full range of features of $TITLE$, the dongle needs to be licensed until at least $MONTHDATE$-$YEARDATE$.$NEWLINE$$NEWLINE$Your dongle reports a final care date of $DONGLEMONTH$-$DONGLEYEAR$. Please be aware that both PrintShop Mail and PrintShop Mail Web will run in demo mode until you upgrade your license.
      end
    end
  else
    MessageBox: $TITLE$, In order to access the full range of features of $TITLE$, the dongle needs to be licensed.
  end
  Set Variable PREREQ to TRUE
  Set Variable PRELIST to $PRELIST$$NEWLINE$PSW Previous Version Uninstallation (WARNING: This step cannot be undone)
end
if Variable LANGUAGE Equals Chinese (PRC)
  Set Variable LANGUAGENUMERICVALUE to 2052
  Set Variable LANGUAGECODEPAGE to 936
end
if Variable LANGUAGE Equals Chinese (Taiwan)
  Set Variable LANGUAGENUMERICVALUE to 1028
  Set Variable LANGUAGECODEPAGE to 950
end
if Variable LANGUAGE Equals Korean
  Set Variable LANGUAGENUMERICVALUE to 1042
  Set Variable LANGUAGECODEPAGE to 949
end
if Variable LANGUAGE Equals Japanese
  Set Variable LANGUAGENUMERICVALUE to 1041
  Set Variable LANGUAGECODEPAGE to 932
end
if Variable LANGUAGE Equals Dutch
  Set Variable LANGUAGENUMERICVALUE to 1043
  Set Variable LANGUAGECODEPAGE to 1252
end
if Variable LANGUAGE Equals German
  Set Variable LANGUAGENUMERICVALUE to 1031
  Set Variable LANGUAGECODEPAGE to 1252
end
if Variable LANGUAGE Equals Spanish
  Set Variable LANGUAGENUMERICVALUE to 1034
  Set Variable LANGUAGECODEPAGE to 1252
end
if Variable LANGUAGE Equals French
  Set Variable LANGUAGENUMERICVALUE to 1036
  Set Variable LANGUAGECODEPAGE to 1252
end
if Variable LANGUAGE Equals Italian
  Set Variable LANGUAGENUMERICVALUE to 1040
  Set Variable LANGUAGECODEPAGE to 1252
end
if Variable LANGUAGE Equals Russian
  Set Variable LANGUAGENUMERICVALUE to 1049
  Set Variable LANGUAGECODEPAGE to 1251
end
if Variable LANGUAGE Equals Turkish
  Set Variable LANGUAGENUMERICVALUE to 1055
  Set Variable LANGUAGECODEPAGE to 1254
end
if Variable LANGUAGE Equals Portugese (Portugal)
  Set Variable LANGUAGENUMERICVALUE to 2070
  Set Variable LANGUAGECODEPAGE to 1252
end
if Variable LANGUAGE Equals English
  Set Variable LANGUAGENUMERICVALUE to 1033
  Set Variable LANGUAGECODEPAGE to 1252
end
Comment: Avoid the user to select an Western Language to install instead of an Asian Language in an Asian OS
Set Variable COMPARISONRESULT to 
Read Registry Key HKLM\System\CurrentControlSet\Control\Nls\Codepage\ACP into OSCODEPAGE
Comment: Do a comparaison between OS and Selected Language code page values.
Evaluate Expression $OSCODEPAGE$ = $LANGUAGECODEPAGE$ into variable COMPARISONRESULT
if Variable COMPARISONRESULT Equals FALSE
  Comment: if Variable OSCODEPAGE not Equals $LANGUAGECODEPAGE$
  if Variable LANGUAGENUMERICVALUE not Equals 1033
    Comment: if Variable LANGUAGECODEPAGE not Equals 1252
    Set Variable OPERATINGSYSTEMLANGUAGE to 
    Get System Setting Language (Text) into OPERATINGSYSTEMLANGUAGE
    MessageBox: Selected Language does not match, $TITLE$ cannot install correctly on this Operating System. Please re-launch the installer and select a language that matches your System Codepage or select English to proceed.
    Terminate Installation
  end
end
if Variable ISWINDOWS64BIT Equals TRUE
  Comment: Include Script: checkmsi31
  Comment: Include Script: checknet20sp2_x64
  Comment: Include Script: checkvc9
  Comment: Include Script: checkvc9_x64
  Comment: Include Script: checkmdac281
  Comment: Include Script: checkmsxml4SP3
  Comment: Include Script: CheckDatabaseEngine_x64
  Comment: Include Script: CheckVFP
  Comment: Include Script: checkmsxml60_x64
else
  if Variable ISWIN2KOS Equals 2000
    Comment: Include Script: checkmsi31
    Comment: Include Script: checkvc9
    Comment: Include Script: checkmdac281
    Comment: Include Script: checkmsxml4SP3
    Comment: Include Script: checknet2sp1
    Comment: Include Script: CheckVFP
  else
    Comment: Include Script: checkmsi31
    Comment: Include Script: checkvc9
    Comment: Include Script: checkmdac281
    Comment: Include Script: checkmsxml4SP3
    Comment: Include Script: checknet2sp2
    Comment: Include Script: CheckDatabaseEngine
    Comment: Include Script: CheckVFP
  end
end
[compiler end]
[END REGION]
Comment:  
[DEFINE REGION: Install Application Pre-Requisites]
if Variable REMOVE Equals TRUE
  Set Variable EXECUTEUNINSTALL to TRUE
end
Comment: Install setup pre-requisites
if Variable PREREQ not Equals FALSE
  Display Dialog: prereq, wait for dialog to return (modal)
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  [compiler if Variable BUILDMODE not Equals PATCH]
  if Variable NEEDSUPGRADE Equals TRUE
    Comment: Read from Text File $TEMPDIR$\PSWBACKUPPATH.txt into Variable OLDPSWPATHLOCATION
    Set Variable STARTMENUPATHLOCATION to 
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
    Set Variable WINDIR to 
    Get Common Folder Location System->Windows Directory into WINDIR
    Set Variable QUOTE to "
    Comment: Declare system variables
    Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
    Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
    Get Folder Location System->Desktop Directory into DESKTOPDIR
    Get Folder Location System->Windows Directory into WINDIR
    Get Folder Location System->System Directory into WINSYSDIR
    Comment: proceed to backup files creation
    Set Variable PSWINSTALLPATH to 
    Set Variable PSMINSTALLPATH to 
    Comment: Read PSM InstallPath for possible custom path 
    Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail\InstallPath into PSMINSTALLPATH
    Comment: Read PSW for old install path
    Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail Web\InstallPath into PSWINSTALLPATH
    Parse String $PSWINSTALLPATH$ into Variables PSWINSTALLPATH and  (Split at first occurrence of pattern)
    Set Persistent Variable  to 
    Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\StartMenuPath into STARTMENUPATHLOCATION
    Comment: get the target dir of the old install path, use PSM because always install
    Parse String $PSMINSTALLPATH$ into Variables PSMINSTALLPATH and  (Split at first occurrence of pattern)
    Comment: Copy old config folder
    Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$PSWINSTALLPATH$Apache\conf\httpd.conf$QUOTE$  $QUOTE$$PSWINSTALLPATH$Apache\conf\httpd.conf.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable HTTPCOPY)
    Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$PSWINSTALLPATH$Apache\PHP\php.ini$QUOTE$  $QUOTE$$PSWINSTALLPATH$Apache\PHP\php.ini.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable PHPCOPY)
    Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$PSWINSTALLPATH$Apache\conf\ssl.conf$QUOTE$  $QUOTE$$PSWINSTALLPATH$Apache\conf\ssl.conf.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable SSLCOPY)
    Comment: Put the stop service here because it launch 3 times PSMail.exe process, so it was impossible to uninstall the installler.
    Run Program $WINSYSDIR$sc.exe stop PrintShopServer (WAIT)
    Run Program $PSMINSTALLPATH$\PrintShop Mail\PSMail.exe  /UnRegServer (WAIT)
    Run Program $PSMINSTALLPATH$\PrintShop Mail\PSMail.exe -deactivate (WAIT)
    if Variable X64DETECTED Equals TRUE
      Unregister Library D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewerx64.dll (get result into variable REGISTERRESULT)
    else
      Unregister Library D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewer.dll (get result into variable REGISTERRESULT)
    end
    Set Variable DEL to 
    Set Variable RMDIR to 
    Run Program $WINSYSDIR$sc.exe stop Apache2 (WAIT)
    Run Program $WINSYSDIR$sc.exe stop MySQL (WAIT)
    Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    Recursively Delete Files $DESKTOPDIR$PrintShop Mail Web.url
    Replace \\ with \ in variable SHORTCUTFOLDER
    Recursively Delete Files $SHORTCUTFOLDER$\*
    Run Program $WINSYSDIR$sc.exe delete Apache2 (WAIT)
    Run Program $WINSYSDIR$sc.exe delete MySQL (WAIT)
    Run Program $WINSYSDIR$sc.exe delete PrintShopServer (WAIT)
    Recursively Delete Files $TARGETDIR$\PrintShop Mail\*
    Recursively Delete Files $TARGETDIR$\PrintShop Mail Web\MySQL\bin\*
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        Reboot Computer and Resume Setup
      else
        Terminate Installation
      end
    end
    Set Variable MAINTENANCE to FALSE
  end
  Comment: Uninstall PSW previous version before installing the current one.
  if Variable PSW2 Equals TRUE
    Comment: Stop the services to avoid the port 80 to be use by Apache
    Run Program $WINSYSDIR$sc.exe stop Apache2 (WAIT)
    Run Program $WINSYSDIR$sc.exe stop MySQL (WAIT)
    Run Program $WINSYSDIR$sc.exe stop PrintShopServer (WAIT)
    Set Variable DEBUG to 
    Set Variable PSSFODLERFOUND to 
    Read from Text File $TEMPDIR$\PSWBACKUPPATH.txt into Variable OLDPSW
    Set Persistent Variable OLDPSWPATH to $OLDPSW$
    Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$OLDPSWPATH$Apache\conf\httpd.conf$QUOTE$  $QUOTE$$OLDPSWPATH$Apache\conf\httpd.conf.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable HTTPCOPY)
    Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$OLDPSWPATH$Apache\PHP\php.ini$QUOTE$  $QUOTE$$OLDPSWPATH$Apache\PHP\php.ini.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable PHPCOPY)
    Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$OLDPSWPATH$Apache\conf\ssl.conf$QUOTE$  $QUOTE$$OLDPSWPATH$Apache\conf\ssl.conf.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable SSLCOPY)
    Does File Exist $OLDPSWPATH$PrintShop Server (get result into variable PSSFODLERFOUND)
    if Variable PSSFODLERFOUND Equals TRUE
      Set Variable PROGRESSTEXT to Uninstalling PrintShop Web 
    end
    if Variable ISWINDOWS64BIT Equals TRUE
      Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
    end
    Set Variable PROGRESSTEXT to Uninstalling PrintShop Web
    Run Program $WINDIR$system32\msiexec.exe /X$PSWPRODUCTCODE$ /qn /norestart (WAIT, get result into variable SUCCESS)
    Comment: Remove the old printer
    Run Program $WINSYSDIR$sc.exe stop Spooler (WAIT)
    Comment: Clear all jobs queue of the printer before uninstalling it
    Run Program $WINDIR$system32\cmd.exe  /c DEL $QUOTE$$WINDIR$system32\spool\printers\*.*$QUOTE$ /S /Q (WAIT)
    Run Program $WINDIR$system32\rundll32.exe  printui.dll,PrintUIEntry /q /dl /n "PrintShop Mail Printer" (WAIT)
    Comment: Delete or Remove the old printer installed
    Run Program $WINSYSDIR$sc.exe stop Spooler (WAIT)
    Run Program $WINDIR$system32\rundll32.exe  printui.dll,PrintUIEntry /q /dl /n  "PrintShop Server PS Printer"  (WAIT)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_CURRENT_USER\Printers$QUOTE$ /v "DeviceOld" /f (WAIT, get result into variable PSMDVAL)
    Run Program $WINSYSDIR$sc.exe start Spooler (WAIT)
    Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
  end
end
if Variable ISWINDOWS64BIT Equals TRUE
  [DEFINE WEB MEDIA Microsoft .NET Framework 2.0 with Service Pack 2 (x64)]
  Comment: Include Script: setupnet20sp2_x64
  Comment: Need to be install in x64 in x86 because PSM application is a 32bit application
  [DEFINE WEB MEDIA Microsoft Visual C++ Runtime 9.0 (includes ATL and MFC)]
  Comment: Include Script: setupvc9
  [DEFINE WEB MEDIA Microsoft Visual C++ Runtime 9.0 (includes ATL and MFC) (x64)]
  Comment: Include Script: setupvc9_x64
  [DEFINE WEB MEDIA Microsoft XML Parser 4.0 Service Pack 3]
  Comment: Include Script: setupmsxml4SP3
  [DEFINE WEB MEDIA Microsoft Windows Installer 3.1]
  Comment: Include Script: setupmsi31
  [DEFINE WEB MEDIA Access Database Engine (x64)]
  Comment: Include Script: SetupDatabaseEngine_x64
  [DEFINE WEB MEDIA Microsoft Visual FoxPro OLE DB Provider]
  Comment: Include Script: SetupVFP
  [DEFINE WEB MEDIA Microsoft XML Parser 6.0 (x64)]
  Comment: Include Script: setupmsxml60_x64
else
  [DEFINE WEB MEDIA Microsoft Visual C++ Runtime 9.0 (includes ATL and MFC)]
  Comment: Include Script: setupvc9
  [DEFINE WEB MEDIA Microsoft MDAC Refresh 2.8]
  Comment: Include Script: setupmdac281
  [DEFINE WEB MEDIA Microsoft XML Parser 4.0 Service Pack 3]
  Comment: Include Script: setupmsxml4SP3
  [DEFINE WEB MEDIA Microsoft Windows Installer 3.1]
  Comment: Include Script: setupmsi31
  [DEFINE WEB MEDIA Microsoft .NET Framework 2.0 with Service Pack 1]
  Comment: Include Script: setupnet2sp1
  [DEFINE WEB MEDIA Microsoft .NET Framework 2.0 with Service Pack 2]
  Comment: Include Script: setupnet2sp2
  [DEFINE WEB MEDIA Access Database Engine 2010]
  Comment: Include Script: SetupDatabaseEngine
  [DEFINE WEB MEDIA Microsoft Visual FoxPro OLE DB Provider]
  Comment: Include Script: SetupVFP
  [compiler end]
  Hide Dialog
end
[END REGION]
 
[END REGION]
Set Persistent Variable MYLANGUAGE to #LANGUAGE#
 
[DEFINE REGION: Define Setup Globals]
Comment: Define Setup Components
Define Component: PSMSuite 7\PrintShop Mail
Define Component: PSMSuite 7\PrintShop Mail Web\MYSQL
Define Component: PSMSuite 7\PrintShop Mail Web\Apache
Define Component: PSMSuite 7\PrintShop Mail Web
Define Component: PSMSuite 7
 
Comment: Initialize Setup Globals
Get System Setting Windows NT Kernel (NT4, 2000, XP, 2003, Vista, 2008) into ISNT
Get Folder Location System->Program Files Directory into PROGRAMFILES
Get Common Folder Location System->Program Files Directory into COMMONFILES
Get Common Folder Location Start Menu->Programs Group into SHORTCUTFILESALL
Get Folder Location Start Menu->Programs Group into SHORTCUTFILES
if Variable SHORTCUTFILESALL Equals 
  Set Variable SHORTCUTFILESALL to $SHORTCUTFILES$
end
Get Folder Location System->Desktop Directory into DESKTOPDIR
Get Folder Location System->Windows Directory into WINDIR
Get Folder Location System->System Directory into WINSYSDIR
Get Folder Location Taskbar->Quick Launch Directory into QUICKLAUNCHDIR
Get Folder Location WWW->WWWRoot into WWWROOTDIR
[END REGION]
 
[DEFINE REGION: Setup User Interview]
if Variable MAINTENANCE Equals TRUE
  GoTo Label: Maintenance
else
  [compiler if Variable BUILDMODE not Equals PATCH]
  Comment: First Time Install
  if Variable PSMINSTALLPATH not Equals 
    Set Variable CUSTOMSTARTMENU to 
    Set Persistent Variable TARGETDIR to $PSMINSTALLPATH$
    Parse String $STARTMENUPATHLOCATION$ into Variables  and CUSTOMSTARTMENU (Split at first occurrence of pattern)
    if Variable CUSTOMSTARTMENU not Equals 
      Set Variable STARTMENU to $CUSTOMSTARTMENU$
    else
      Set Variable STARTMENU to $TITLE$
    end
  else
    Set Variable TARGETDIR to $PROGRAMFILES$\$TITLE$
    Set Variable STARTMENU to $TITLE$
  end
  [compiler end]
end
 
label: Welcome Dialog
Comment: Display the demo message warning
Set Variable PSW2EXIST to 
if Variable LANGUAGE Equals Dutch
  Set Persistent Variable SELECTEDLANGUAGE to Dutch
  Comment: Set Variable SELECTEDLANGUAGE to Nederlands
end
if Variable LANGUAGE Equals English
  Set Persistent Variable SELECTEDLANGUAGE to English
end
if Variable LANGUAGE Equals German
  Set Persistent Variable SELECTEDLANGUAGE to German
  Comment: Set Variable SELECTEDLANGUAGE to Deutsch
end
if Variable LANGUAGE Equals Italian
  Set Persistent Variable SELECTEDLANGUAGE to Italian
  Comment: Set Variable SELECTEDLANGUAGE to Italiano
end
if Variable LANGUAGE Equals Spanish
  Set Persistent Variable SELECTEDLANGUAGE to Spanish
  Comment: Set Variable SELECTEDLANGUAGE to Espaol
end
if Variable LANGUAGE Equals French
  Set Persistent Variable SELECTEDLANGUAGE to French
  Comment: Set Variable SELECTEDLANGUAGE to Franais
end
if Variable LANGUAGE Equals Japanese
  Set Persistent Variable SELECTEDLANGUAGE to Japanese
  Comment: Set Variable SELECTEDLANGUAGE to Japanese - {
end
if Variable LANGUAGE Equals Korean
  Set Persistent Variable SELECTEDLANGUAGE to Korean
  Comment: Set Variable SELECTEDLANGUAGE to Korean - 
end
if Variable LANGUAGE Equals Russian
  Set Persistent Variable SELECTEDLANGUAGE to Russian
  Set Variable SELECTEDLANGUAGE to Russian - 
end
if Variable LANGUAGE Equals Portugese (Portugal)
  Set Persistent Variable SELECTEDLANGUAGE to Portuguese
  Comment: Set Variable SELECTEDLANGUAGE to Portugus
end
if Variable LANGUAGE Equals Turkish
  Set Persistent Variable SELECTEDLANGUAGE to Turkish
  Comment: Set Variable SELECTEDLANGUAGE to Trke
end
if Variable LANGUAGE Equals Chinese (PRC)
  Set Persistent Variable SELECTEDLANGUAGE to Chinese_Simplified
  Comment: Set Variable SELECTEDLANGUAGE to Chinese (Simplified) - 
end
if Variable LANGUAGE Equals Chinese (Taiwan)
  Set Persistent Variable SELECTEDLANGUAGE to Chinese_Traditional
  Comment: Set Variable SELECTEDLANGUAGE to Chinese (Traditional) - c餤
end
Read from Text File $TEMPDIR$\PSWBACKUPPATH.txt into Variable OLDPSW
Set Persistent Variable OLDPSWPATH to $OLDPSW$
Does Folder Exist $OLDPSWPATH$ (get result into variable PSW2EXIST)
if Variable PSW2EXIST Equals FALSE
  MessageBox: $TITLE$, In order to access the full range of features of $TITLE$, the dongle needs to be licensed.
  Comment: MessageBox: $TITLE$, PrintShop Mail Web will be installed as a demo and will therefore be limited.   
end
Display Dialog: welcome, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
[compiler if Variable BUILDMODE not Equals PATCH]
label: License Check
Display Dialog: licensecheck, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
  GoTo Label: Welcome Dialog
else
  if Variable WIZARD Equals CANCEL
    Terminate Installation
  end
end
label: SelectFeatures
Set Variable PSW to FALSE
Display Dialog: SelectFeatures, wait for dialog to return (modal)
Comment: During Maintenance mode
if Variable ISINSTALLED Equals TRUE
  if Variable MODIFY Equals TRUE
    if Variable REPAIR Equals FALSE
      if Variable WIZARD Equals BACK
        GoTo Label: Maintenance
      end
    end
  end
else
  Comment: Normal Sequence
  if Variable WIZARD Equals BACK
    GoTo Label: License Check
  else
    if Variable WIZARD Equals CANCEL
      Terminate Installation
    else
      if Variable SILENT Equals FALSE
        Select Component: PSMSuite 7\PrintShop Mail
        if Variable PSW Equals TRUE
          Select Component: PSMSuite 7\PrintShop Mail Web
          Select Component: PSMSuite 7\PrintShop Mail Web\Apache
          Select Component: PSMSuite 7\PrintShop Mail Web\MYSQL
        else
          Deselect Component: PSMSuite 7\PrintShop Mail Web
          Deselect Component: PSMSuite 7\PrintShop Mail Web\Apache
          Deselect Component: PSMSuite 7\PrintShop Mail Web\MYSQL
        end
        if Variable BARCOD Equals TRUE
        else
        end
        if Variable OLAP Equals TRUE
        else
        end
        if Variable DSM Equals TRUE
        else
        end
      end
    end
  end
end
label: ApacheOptions
if Variable REPAIR Equals FALSE
  if Variable PSW Equals TRUE
    Display Dialog: ApacheOptions, wait for dialog to return (modal)
    if Variable WIZARD Equals BACK
      GoTo Label: SelectFeatures
    else
      if Variable WIZARD Equals CANCEL
        Terminate Installation
      else
        Comment: Next button
        Set Variable PORTSCANRESULT to TRUE
        Set Variable PORTSCANRESULT2 to 
        Set Variable HTTPORTVALUERANGE to 
        Set Variable HTTPSPORTVALUERANGE to 
        Set Variable HTTPSPORTVALUERANGE1 to 
        Set Variable HIGHERPORTVALUE to 65535
        Set Variable LOWERPORTVALUE to 1
        Evaluate Expression $HTTPORTVALUE$ < $HIGHERPORTVALUE$ into variable HTTPORTVALUERANGE
        Evaluate Expression $HTTPORTVALUE$ > $LOWERPORTVALUE$ into variable HTTPORTVALUERANGE1
        Evaluate Expression $APACHEHTTPSPORTNUMBER$ < $HIGHERPORTVALUE$ into variable HTTPSPORTVALUERANGE
        Evaluate Expression $APACHEHTTPSPORTNUMBER$ > $LOWERPORTVALUE$ into variable HTTPSPORTVALUERANGE1
        Comment: Avoid to enter any invalid port number containing symbols
        if Variable HTTPORTVALUERANGE Equals FALSE
          if Variable HTTPORTVALUERANGE1 Equals FALSE
            MessageBox: Invalid port, Invalid HTTP Port number
            GoTo Label: ApacheOptions
          end
        end
        if Variable HTTPSPORTVALUERANGE Equals FALSE
          if Variable HTTPSPORTVALUERANGE1 Equals FALSE
            MessageBox: Invalid port, Invalid HTTPS Port number
            GoTo Label: ApacheOptions
          end
        end
        if Variable HTTPORTVALUE Contains -
          MessageBox: Invalid port, Invalid HTTP Port number
          GoTo Label: ApacheOptions
        end
        if Variable HTTPSCHECKBOXVALUE Equals TRUE
          if Variable APACHEHTTPSPORTNUMBER Contains -
            MessageBox: Invalid port, Invalid HTTPS Port number
            GoTo Label: ApacheOptions
          end
        end
        if Variable HTTPORTVALUE Contains +
          MessageBox: Invalid port, Invalid HTTP Port number
          GoTo Label: ApacheOptions
          Comment: Parse String $HTTPORTVALUE$ into Variables  and HTTPORTVALUE (Split at first occurrence of pattern)
        end
        if Variable HTTPSCHECKBOXVALUE Equals TRUE
          if Variable APACHEHTTPSPORTNUMBER Contains +
            MessageBox: Invalid port, Invalid HTTPS Port number
            GoTo Label: ApacheOptions
            Comment: Parse String $APACHEHTTPSPORTNUMBER$ into Variables  and APACHEHTTPSPORTNUMBER (Split at first occurrence of pattern)
          end
        end
        if Variable HTTPORTVALUE Equals 0
          MessageBox: Invalid port, Invalid HTTP Port number
          GoTo Label: ApacheOptions
        end
        if Variable HTTPSCHECKBOXVALUE Equals TRUE
          if Variable APACHEHTTPSPORTNUMBER Equals 0
            MessageBox: Invalid port, Invalid HTTPS Port number
            GoTo Label: ApacheOptions
          end
        end
        if Variable HTTPORTVALUE not Equals 
          Comment: PSW Port number "HTTPORTVALUE" state : (get result into variable PORTSCANRESULT)
          if Variable PORTSCANRESULT Equals FALSE
            Set Variable CONTINUEANYWAY to TRUE
            MessageBox: Error port in use, Port $HTTPORTVALUE$ is being used by another application. Setup will not be able to start the service after the installation. Do you want to continue?
            if Variable CONTINUEANYWAY Equals NO
              GoTo Label: ApacheOptions
            else
              Set Variable PORTSCANRESULT to TRUE
            end
          end
        else
          MessageBox: Empty port, Please enter an HTTP port number to continue the installation.
          GoTo Label: ApacheOptions
        end
        if Variable PORTSCANRESULT Equals ERROR
          MessageBox: Invalid port, Invalid HTTP Port number
          GoTo Label: ApacheOptions
        end
        if Variable HTTPSCHECKBOXVALUE Equals TRUE
          if Variable APACHEHTTPSPORTNUMBER not Equals 
            Comment: PSW Port number "APACHEHTTPSPORTNUMBER" state : (get result into variable PORTSCANRESULT2)
            if Variable PORTSCANRESULT2 Equals FALSE
              MessageBox: Error port in use, Port $APACHEHTTPSPORTNUMBER$ is being used by another application. Setup will not be able to start the service after the installation. Do you want to continue?
              if Variable CONTINUEANYWAY Equals NO
                GoTo Label: ApacheOptions
              else
                Set Variable PORTSCANRESULT2 to TRUE
              end
            end
          else
            MessageBox: Empty port, Please enter an HTTPS port number to continue the installation.
            GoTo Label: ApacheOptions
          end
        end
        if Variable HTTPSCHECKBOXVALUE Equals TRUE
          if Variable PORTSCANRESULT2 Equals ERROR
            MessageBox: Invalid port, Invalid HTTPS Port number
            GoTo Label: ApacheOptions
          end
        end
        if Variable PORTSCANRESULT Equals TRUE
          GoTo Label: PSS Credentials
        else
          GoTo Label: ApacheOptions
        end
        if Variable PORTSCANRESULT2 Equals TRUE
          GoTo Label: PSS Credentials
        else
          GoTo Label: ApacheOptions
        end
      end
    end
  end
end
label: PSS Credentials
if Variable REPAIR Equals FALSE
  if Variable PSW Equals TRUE
    Display Dialog: PSS Credentials, wait for dialog to return (modal)
    if Variable WIZARD Equals BACK
      GoTo Label: ApacheOptions
    else
      if Variable WIZARD Equals CANCEL
        Terminate Installation
      end
    end
    if Variable HTTPSCHECKBOXVALUE Equals TRUE
      if Variable PORTSCANRESULT Equals TRUE
        if Variable PORTSCANRESULT2 Equals TRUE
          Display Dialog: PSS Credentials, wait for dialog to return (modal)
          if Variable WIZARD Equals BACK
            GoTo Label: ApacheOptions
          else
            if Variable WIZARD Equals CANCEL
              Terminate Installation
              Comment: else
            end
          end
        end
      end
    end
  end
end
label: Destination Directory
if Variable PSW Equals TRUE
  Comment: Next button
  Set Variable CHECKRESULT to 
  if Variable SILENT Equals TRUE
    Comment: Set Variable COMMANDLINE to $CMDLINE$
    if Variable COMMANDLINE Contains (Ignore Case) PASSWORD=
      Set Variable MYPASSWORD to 
      Parse String $COMMANDLINE$ into Variables  and WORD (Split at first occurrence of pattern)
      Parse String $WORD$ into Variables MYPASSWORD and  (Split at first occurrence of pattern)
      Set Persistent Variable PSSWORD to $MYPASSWORD$
    end
  end
  Comment: PSW Is Logon Valid :  validate "PSSUSER", "PSSWORD", "PSSDOMAIN" (get result into variable CHECKRESULT)
  if Variable CHECKRESULT Equals ERROR
    if Variable PSSWORD Equals 
      if Variable ISWIN2KOS not Equals 2000
        MessageBox: Password Field Empty, The password field is empty.The software requires that your account to have a password. If your account does not have a password yet please edit your account in Windows to give it a password.
        GoTo Label: PSS Credentials
      end
    end
  end
  if Variable CHECKRESULT Equals ERROR
    MessageBox: Incorrect Password, The password is incorrect.
    GoTo Label: PSS Credentials
  else
    if Variable CHECKRESULT Equals SUCCESS
      if Variable ISINSTALLED Equals FALSE
        Display Dialog: destination, wait for dialog to return (modal)
        if Variable WIZARD Equals BACK
          GoTo Label: PSS Credentials
        else
          if Variable WIZARD Equals CANCEL
            Terminate Installation
          end
        end
      end
    end
  end
else
  if Variable ISINSTALLED Equals FALSE
    Display Dialog: destination, wait for dialog to return (modal)
    if Variable WIZARD Equals BACK
      GoTo Label: SelectFeatures
    else
      if Variable WIZARD Equals CANCEL
        Terminate Installation
      end
    end
  end
end
label: Start Menu
if Variable TARGETDIR Equals 
  MessageBox: Invalid Destination Path, Please enter a valid destination path to continue the installation.
  GoTo Label: Destination Directory
else
  if Variable PSW Equals TRUE
    Set Variable SERVICERESULT to 
    if Variable SILENT Equals TRUE
      Comment: Set Variable COMMANDLINE to $CMDLINE$
      if Variable COMMANDLINE Contains (Ignore Case) PASSWORD=
        Set Variable MYPASSWORD to 
        Parse String $COMMANDLINE$ into Variables  and WORD (Split at first occurrence of pattern)
        Parse String $WORD$ into Variables MYPASSWORD and  (Split at first occurrence of pattern)
        Set Persistent Variable PSSWORD to $MYPASSWORD$
      end
    end
    Comment: PSW Logon As Service : Check user "PSSUSER" account rights in domain "PSSDOMAIN" to logon as service and get result into variable SERVICERESULT
  end
  Set Variable GUIDVALUE to 
  Comment: PSWCreateGUID plug-in :  get result into variable GUIDVALUE
  if Variable ISINSTALLED Equals FALSE
    Display Dialog: startmenu, wait for dialog to return (modal)
    if Variable WIZARD Equals BACK
      GoTo Label: Destination Directory
    else
      if Variable WIZARD Equals CANCEL
        Terminate Installation
      end
    end
  end
end
[compiler end]
label: Start Installation
Display Dialog: startinstallation, wait for dialog to return (modal)
Comment: if PSM is the only feature selected uring maintenance
if Variable ISINSTALLED Equals TRUE
  if Variable MODIFY Equals TRUE
    if Variable PSW Equals FALSE
      if Variable REPAIR Equals FALSE
        if Variable WIZARD Equals BACK
          GoTo Label: SelectFeatures
        else
          if Variable WIZARD Equals CANCEL
            Terminate Installation
          end
        end
      end
    end
  end
end
if Variable ISINSTALLED Equals TRUE
  if Variable MODIFY Equals TRUE
    if Variable REPAIR Equals FALSE
      if Variable WIZARD Equals BACK
        GoTo Label: PSS Credentials
      else
        if Variable WIZARD Equals CANCEL
          Terminate Installation
        end
      end
    end
  end
end
if Variable ISINSTALLED Equals TRUE
  if Variable MODIFY Equals FALSE
    if Variable WIZARD Equals BACK
      GoTo Label: Maintenance
    else
      if Variable WIZARD Equals CANCEL
        Terminate Installation
      end
    end
  end
end
if Variable WIZARD Equals BACK
  [compiler if Variable BUILDMODE not Equals PATCH]
  GoTo Label: Start Menu
  [compiler else]
  GoTo Label: Welcome Dialog
  [compiler end]
else
  GoTo Label: Main Install
end
 
label: Maintenance
Display Dialog: maintenance, wait for dialog to return (modal)
if Variable WIZARD Equals CANCEL
  Terminate Installation
end
if Variable ISINSTALLED Equals TRUE
  if Variable MODIFY Equals TRUE
    if Variable REPAIR Equals FALSE
      GoTo Label: selectFeatures
    end
  end
end
GoTo Label: Start Installation
Comment: Display Dialog: startinstallation, wait for dialog to return (modal)
if Variable ISINSTALLED Equals TRUE
  if Variable REPAIR Equals FALSE
    if Variable WIZARD Equals BACK
      GoTo Label: PSS Credentials
    end
  end
end
if Variable ISINSTALLED Equals TRUE
  if Variable MODIFY Equals FALSE
    if Variable REPAIR Equals FALSE
      if Variable WIZARD Equals BACK
        GoTo Label: Maintenance
      end
    end
  end
end
[END REGION]
 
[DEFINE REGION: Process (Un)Installation]
label: Main Install
Comment: Exit Setup if Wizard Loop cancelled
if Variable WIZARD Equals CANCEL
  Terminate Installation
   
end
 
Comment: Set the variable to detect if the old version folder exist
 
 
Comment: Prepare to install
if Variable REMOVE Equals TRUE
  Set Variable PROGRESSTEXT to Uninstalling $TITLE$
else
  Set Variable PROGRESSTEXT to Installing $TITLE$
end
Set Variable SUCCESS to 
Set Variable LASTERROR to 
Display Dialog: progress, use as progress dialog (non-modal)
 
Comment: Modify Target System
[DEFINE REGION: Perform Uninstallation]
if Variable REMOVE Equals TRUE
  Set Variable WINDIR to 
  Get Common Folder Location System->Windows Directory into WINDIR
  Set Variable QUOTE to "
  Comment: proceed to backup files creation
  Set Variable PSWINSTALLPATH to 
  Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail Web\InstallPath into PSWINSTALLPATH
  Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$PSWINSTALLPATH$Apache\conf\httpd.conf$QUOTE$  $QUOTE$$PSWINSTALLPATH$Apache\conf\httpd.conf.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable HTTPCOPY)
  Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$PSWINSTALLPATH$Apache\PHP\php.ini$QUOTE$  $QUOTE$$PSWINSTALLPATH$Apache\PHP\php.ini.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable PHPCOPY)
  Run Program $WINDIR$System32\cmd.exe /c copy $QUOTE$$PSWINSTALLPATH$Apache\conf\ssl.conf$QUOTE$  $QUOTE$$PSWINSTALLPATH$Apache\conf\ssl.conf.$DAY$.$MONTH$.$YEAR$-$HOUR$.$MINUTE$$QUOTE$ (WAIT, get result into variable SSLCOPY)
  Comment: ADD the entries for RunOnce to delete all left overs after Uninstall
  Set Variable MYDELETEPATH to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCTCODE$
  Set Variable MYTITLEPATH to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$TITLE$
  if Variable X64DETECTED Equals TRUE
    Set Variable MYDELETEPATHX64 to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$PRODUCTCODE$
    Set Variable MYTITLEPATHX64 to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\$TITLE$
  end
  Set Variable MYARPPATH to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Management\ARPCache\$TITLE$
  Set Variable MYARPPRODUCTCODEPATH to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Management\ARPCache\$PRODUCTCODE$
  Set Variable UNKNOWKEYPATH to HKEY_CLASSES_ROOT\Installer\Products\$SECRETPRODUCTCODE$
  Set Variable UNKNOWCLASSROOTPATH to HKEY_LOCAL_MACHINE\Software\Classes\Installer\Products\$SECRETPRODUCTCODE$
  Set Variable INSTALLERSECRETCODEPATH to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$
  Set Variable LASTKEYPATH to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$
  Set Variable DELETEPSSKEY to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$
  Run Program $WINSYSDIR$sc.exe stop PrintShopServer (WAIT)
  Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail\InstallPath into PSMINSTALLPATH
  Run Program $PSMINSTALLPATH$PSMail.exe  /UnRegServer (WAIT)
  Run Program $PSMINSTALLPATH$PSMail.exe -deactivate (WAIT)
  if Variable X64DETECTED Equals TRUE
    Unregister Library D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewerx64.dll (get result into variable REGISTERRESULT)
  else
    Unregister Library D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewer.dll (get result into variable REGISTERRESULT)
  end
  Comment: Run Program $WINDIR$system32\regsvr32.exe $QUOTE$$PSMINSTALLPATH$Libraries\PrintShop Mail ThumbnailViewer.dll$QUOTE$ (WAIT, get result into variable REGSERVERVALUE)
  Run Program $WINSYSDIR$sc.exe stop Apache2 (WAIT)
  Run Program $WINSYSDIR$sc.exe stop MySQL (WAIT)
  Comment: Run Program $WINSYSDIR$sc.exe stop PrintShopServer (WAIT)
  Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
  Recursively Delete Files $DESKTOPDIR$PrintShop Mail Web.url
  Replace \\ with \ in variable SHORTCUTFOLDER
  Recursively Delete Files $SHORTCUTFOLDER$\*
  Run Program $WINSYSDIR$sc.exe delete Apache2 (WAIT)
  Run Program $WINSYSDIR$sc.exe delete MySQL (WAIT)
  Run Program $WINSYSDIR$sc.exe delete PrintShopServer (WAIT)
  Recursively Delete Files $TARGETDIR$\PrintShop Mail\*
  Recursively Delete Files $TARGETDIR$\PrintShop Mail Web\MySQL\bin\*
  Recursively Delete Files $SHORTCUTFOLDER$
  Comment: Remove the old printer
  Comment: Clear all jobs queue of the printer before uninstalling it
  Run Program $WINSYSDIR$sc.exe stop Spooler (WAIT)
  Run Program $WINDIR$system32\cmd.exe  /c DEL $QUOTE$$WINDIR$system32\spool\printers\*.*$QUOTE$ /S /Q (WAIT)
  Run Program $WINDIR$system32\rundll32.exe  printui.dll,PrintUIEntry /q /dl /n "PrintShop Mail Printer" (WAIT)
  Comment: end
  Apply Uninstall (get result into variable SUCCESS)
  Comment: Run Program $WINSYSDIR$sc.exe stop Spooler (WAIT)
  Set Variable PROGRESS to 100
end
[END REGION]
[DEFINE REGION: Perform First Time or Maintenance Installation]
Comment: Search for PSW 2.2.0/2.2.1
 
Comment: During Repair Mode check the features states
Set Variable ALREADYINSTALL to 
Get Installed State for $PRODUCTCODE$ into Variable ALREADYINSTALL
if Variable ALREADYINSTALL Equals TRUE
  if Variable REPAIR Equals TRUE
    if Variable MODIFY Equals FALSE
      if Variable REMOVE Equals FALSE
        Comment: Comment: Get the feature states
        Comment: Get the feature states
        Set Persistent Variable PSW to $PSWFEATURE$
        Set Persistent Variable BARCOD to $BPLUGINFEATURE$
        Set Persistent Variable DSM to $DSMPLUGINFEATURE$
        Set Persistent Variable OLAP to $OPLUGINFEATURE$
        Set Persistent Variable PSSUSER to $PSSUSER$
        Set Persistent Variable PSSWORD to $PSSWORD$
        Set Persistent Variable PSSDOMAIN to $PSSDOMAIN$
      end
    end
  end
end
 
Comment: Install/Re-Install product
[OFFLINE CONTENT]
[DEFINE WEB MEDIA PSMSuite 7]
Comment: Comment: GET the cmdline parameters variable
if Variable SILENT Equals TRUE
  Set Variable COMMANDLINE to $CMDLINE$
  if Variable COMMANDLINE Contains (Ignore Case) PASSWORD=
    Set Variable MYPASSWORD to 
    Parse String $COMMANDLINE$ into Variables  and WORD (Split at first occurrence of pattern)
    Parse String $WORD$ into Variables MYPASSWORD and  (Split at first occurrence of pattern)
    Set Persistent Variable PSSWORD to $MYPASSWORD$
  end
  if Variable COMMANDLINE Contains (Ignore Case) PRINTSHOPWEB=0
    Set Variable PSW to FALSE
  else
    if Variable COMMANDLINE Contains (Ignore Case) PRINTSHOPWEB=1
      Set Variable PSW to TRUE
    end
  end
  if Variable COMMANDLINE Contains (Ignore Case) BARCODEPLUGIN=0
    Set Variable BARCOD to FALSE
  else
    Set Variable BARCOD to TRUE
  end
  if Variable COMMANDLINE Contains (Ignore Case) OLAPLUGIN=0
    Set Variable OLAP to FALSE
  else
    Set Variable OLAP to TRUE
  end
  if Variable COMMANDLINE Contains (Ignore Case) DSMPLUGIN=0
    Set Variable DSM to FALSE
  else
    Set Variable DSM to TRUE
  end
  if Variable COMMANDLINE Contains (Ignore Case) APACHEHTTPSPORTNUMBER=
    Set Variable HTTPSCHECKBOXVALUE to TRUE
  else
    Set Variable HTTPSCHECKBOXVALUE to FALSE
  end
  if Variable COMMANDLINE Contains (Ignore Case) BIND=0
    Set Variable BINDCHECKBOX to FALSE
  else
    Set Variable BINDCHECKBOX to TRUE
  end
end
Get Component PSMSuite 7\PrintShop Mail Selection State into Variable SELECTED
if Variable PSM Equals TRUE
  if Variable STARTMENU not Equals $TITLE$
    Set Variable SHORTCUTFOLDER to $SHORTCUTFILESALL$\$STARTMENU$
  end
  if Variable REMOVE Equals FALSE
    Comment: Requested by Sander 04th January 2010
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Excel\ImportMixedTypes, Text (permanent)
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Excel\TypeGuessRows, 00000000 (permanent)
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Xbase\BDE, 00000002 (permanent)
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Text\,  (permanent)
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Text\MaxScanRows, 2147483647 (permanent)
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Text\ImportMixedTypes, Text (permanent)
    Write Registry Key HKLM\Software\PrintShop Mail\7.0\Jet 4.0\Engines\Text\Format, CSVDelimited (permanent)
    Set Variable INSTALLIDEXIST to 
    Check Registry Key HKLM\Software\Objectif Lune\install ID into INSTALLIDEXIST
    if Variable INSTALLIDEXIST Equals NO$KEY
      Write Registry Key HKLM\Software\Objectif Lune\install ID, $GUIDVALUE$ (permanent)
    end
    Set Variable INSTALLERVERSION to #IAVERSIONNUMBER#
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\Version, $INSTALLERVERSION$
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\StartMenuPath, $SHORTCUTFOLDER$
    Set Read Write Permissions on Registry Key "HKLM\Software\Objectif Lune" for Everyone 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\xml\*.* to $TARGETDIR$\PrintShop Mail \xml, ignore files matching wildcard pattern(s) *svn;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Themes\*.* to $TARGETDIR$\PrintShop Mail \Themes, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\A*.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\B*.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PSMail_*.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\ConvANO.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\Elevator.exe to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\JP2KLib.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\nserver.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PPWatchAct.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\SBarMPT.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\usps4cb.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root;, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\APDFL\*.* to $TARGETDIR$\PrintShop Mail \Libraries\APDFL, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\CMap\*.* to $TARGETDIR$\PrintShop Mail \CMap, include subfolders
    if Variable X64DETECTED Equals TRUE
      Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewerx64.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    else
      Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewer.dll to $TARGETDIR$\PrintShop Mail \Libraries, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    end
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\KIX RiskTable\*.* to $TARGETDIR$\PrintShop Mail \KIX RiskTable, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Fonts\*.* to $TARGETDIR$\PrintShop Mail \Fonts, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\TFHandle.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\ComponentFactory.Krypton.Toolkit.DLL to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\haspdinst.exe to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\hfcache.tmp to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\MultiUp.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PrintShopCommunication.xsd to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\ps.vm to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMail7.joboptions to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMail7_lowres.joboptions to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMail.exe to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMail.exe.config to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMail_color.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMail_Interop.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PSMailAPI.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\PsmLibrary60.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Release Notes.pdf to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Skybound.VisualTips.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\SmartPropertyGrid.dll to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\superatm.db to $TARGETDIR$\PrintShop Mail 
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Examples\*.* to $TARGETDIR$\PrintShop Mail \Examples, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Plug-Ins since it always installed
    Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Plugins\*.* to $TARGETDIR$\PrintShop Mail \Plugins, ignore files matching wildcard pattern(s) *svn;*entries*;Repository;Root, include subfolders
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\Barcode Plugin\BarcodePluginPath, $TARGETDIR$\PrintShop Mail\Plugins
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\OLA Plugin\OLAPluginPath, $TARGETDIR$\PrintShop Mail\Plugins
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\DirectSmile Plugin\DirectSmilePluginPath, $TARGETDIR$\PrintShop Mail\Plugins
    Comment: Added GDIPLUS and REG.exe  tool for Windows 2000 O.S.
    if Variable ISWIN2KOS Equals 2000
      Comment: Install Files D:\Develop\Internal\PrintShopMailSuite\reg.exe to $WINDIR$system32 (Permanent, Never Overwrite), ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
      Comment: Install Files D:\Develop\Internal\PrintShopMailSuite\gdiplus.dll to $WINSYSDIR$
    end
    if Variable X64DETECTED Equals TRUE
      Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
      Set Variable WINSYSDIRX64 to 
      Get Common Folder Location System->System Directory into WINSYSDIRX64
      Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Support Files\Adobe ICC Profiles (bundler)\CMYK Profiles\*.* to $TEMPDIR$, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
      Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Support Files\Adobe ICC Profiles (bundler)\RGB Profiles\*.* to $TEMPDIR$, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
      Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
    else
      Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Support Files\Adobe ICC Profiles (bundler)\CMYK Profiles\*.* to $TEMPDIR$, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
      Comment: Install Files D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Support Files\Adobe ICC Profiles (bundler)\RGB Profiles\*.* to $TEMPDIR$, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    end
    Comment: Create Shortcut $DESKTOPDIR$\PrintShop Mail 7 to $TARGETDIR$\PrintShop Mail\PSMail.exe
    Comment: Create Shortcut $SHORTCUTFOLDER$\PrintShop Mail 7 to $TARGETDIR$\PrintShop Mail\PSMail.exe
    Comment: Create Shortcut $SHORTCUTFOLDER$\PrintShop Mail 7 Net to $TARGETDIR$\PrintShop Mail\PSMail.exe
    Comment: Create Shortcut $SHORTCUTFOLDER$\Release Notes to $TARGETDIR$\PrintShop Mail\Release Notes.pdf
    Comment: Create a file type extension for document and template 
    Create File Type PrintShopMail6.Document with extensions .PSMD and associate with program $TARGETDIR$\PrintShop Mail\PSMail.exe
    Create File Type PrintShopMail6.Template with extensions .PSMT and associate with program $TARGETDIR$\PrintShop Mail\PSMail.exe 
    Comment: Installed file and shortcuts for UpdateClient
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.DE to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.EN to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.ES to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.FR to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.exe to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.IT to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Comment: Install Files D:\Develop\Runtimes\UpdateClient\UpdateClient.JP to $COMMONFILES$Objectif Lune\Update Client (Shared), include subfolders
    Create Shortcut $SHORTCUTROOT$\UpdateClient to $COMMONFILES$Objectif Lune\Update Client\UpdateClient.exe
    Comment: Write to the right node for x64 O.S.
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail\InstallPath, $TARGETDIR$\PrintShop Mail\
    Comment: On windows vista and higher must copy the driver to a temporary folder to install
    Set Variable WINDOWSVERNB to 
    Check Registry Key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion into WINDOWSVERNB
    if Variable WINDOWSVERNB Greater Than 5.2
      Comment: Install Files D:\Develop\Internal\InstallPrinterDriverDll\PSMSuite\*.* to $TEMPDIR$PSMSUITE7DRIVER, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    else
      Comment: Install Files D:\Develop\Internal\InstallPrinterDriverDll\PSMSuite\*.* to $WINDIR$inf\Printers, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    end
    Comment: Clean all vcredist files left over after installation
    Set Variable SYSDRIVE to C:
    Delete Files $SYSDRIVE$\eula.1028.txt (when installing)
    Delete Files $SYSDRIVE$\eula.1031.txt (when installing)
    Delete Files $SYSDRIVE$\eula.1033.txt (when installing)
    Delete Files $SYSDRIVE$\eula.1036.txt (when installing)
    Delete Files $SYSDRIVE$\eula.1040.txt (when installing)
    Delete Files $SYSDRIVE$\eula.1041.txt (when installing)
    Delete Files $SYSDRIVE$\eula.1042.txt (when installing)
    Delete Files $SYSDRIVE$\eula.2052.txt (when installing)
    Delete Files $SYSDRIVE$\eula.3082.txt (when installing)
    Delete Files $SYSDRIVE$\globdata.ini (when installing)
    Delete Files $SYSDRIVE$\install.exe (when installing)
    Delete Files $SYSDRIVE$\install.ini (when installing)
    Delete Files $SYSDRIVE$\install.res.1028.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.1031.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.1033.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.1036.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.1040.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.1041.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.1042.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.2052.dll (when installing)
    Delete Files $SYSDRIVE$\install.res.3082.dll (when installing)
    Delete Files $SYSDRIVE$\VC_RED.cab (when installing)
    Delete Files $SYSDRIVE$\VC_RED.MSI (when installing)
    Delete Files $SYSDRIVE$\vcredist.bmp (when installing)
  end
end
[DEFINE WEB MEDIA PrintShop Mail Web]
Get Component PSMSuite 7\PrintShop Mail Web Selection State into Variable SELECTED
Get Component PSMSuite 7\PrintShop Mail Web Selection State into Variable SELECTED
if Variable PSW Equals TRUE
  if Variable REMOVE Equals FALSE
    Create Folder $TARGETDIR$\PrintShop Mail Web
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\Website\*.* to $TARGETDIR$\PrintShop Mail Web\Website, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\configfiles\*.* to $TARGETDIR$\PrintShop Mail Web\Website\configfiles, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\dialogs\*.* to $TARGETDIR$\PrintShop Mail Web\Website\dialogs, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\files\*.* to $TARGETDIR$\PrintShop Mail Web\Website\files, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\forms\*.* to $TARGETDIR$\PrintShop Mail Web\Website\forms, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\functions\*.* to $TARGETDIR$\PrintShop Mail Web\Website\functions, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\images\*.* to $TARGETDIR$\PrintShop Mail Web\Website\images, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\include\*.* to $TARGETDIR$\PrintShop Mail Web\Website\include, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\misc\*.* to $TARGETDIR$\PrintShop Mail Web\Website\misc, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\modules\*.* to $TARGETDIR$\PrintShop Mail Web\Website\modules, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\pages\*.* to $TARGETDIR$\PrintShop Mail Web\Website\pages, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\soap_1_3\*.* to $TARGETDIR$\PrintShop Mail Web\Website\soap_1_3, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\templates\*.* to $TARGETDIR$\PrintShop Mail Web\Website\templates (Shared, Permanent), ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\website\webintegration\*.* to $TARGETDIR$\PrintShop Mail Web\Website\webintegration, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Empty folder creation asked by Robbie
    Create Folder $TARGETDIR$\PrintShop Mail Web\Website\images\captcha
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Support Files\PSW.ico to $TARGETDIR$\PrintShop Mail Web\Website, ignore files matching wildcard pattern(s) *svn;CVS;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\PSS\*.* to $TARGETDIR$\PrintShop Mail Web\PrintShop Server, ignore files matching wildcard pattern(s) PrintShop Server.exe;*svn;*entries*;Repository;Root, include subfolders
    Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\Library\*.* to $TARGETDIR$\PrintShop Mail Web\Library, ignore files matching wildcard pattern(s) *svn;*entries*;Repository;Root;*., include subfolders
    Create Shortcut $SHORTCUTFOLDER$\PrintShop Mail Web Services Manager to $TARGETDIR$\PrintShop Mail Web\PrintShop Server\PSSManager.exe
    Create Shortcut $DESKTOPDIR$\PrintShop Mail Web Services Manager to $TARGETDIR$\PrintShop Mail Web\PrintShop Server\PSSManager.exe
    Write Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail Web\InstallPath, $TARGETDIR$\PrintShop Mail Web\
    Write Registry Key HKLM\SYSTEM\CurrentControlSet\Services\Apache2\Parameters\ConfigArgs, $TARGETDIR$\PrintShop Mail Web\Apache
    Write Registry Key HKLM\SYSTEM\CurrentControlSet\Services\Apache2\Parameters\ConfigArgs, -d
    Write Registry Key HKLM\SYSTEM\CurrentControlSet\Services\Apache2\Parameters\ConfigArgs, $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf
    Write Registry Key HKLM\SYSTEM\CurrentControlSet\Services\Apache2\Parameters\ConfigArgs, -f
    Create Folder $TARGETDIR$\PrintShop Mail Web\Website\files
    Set Variable LogonServiceResult to 
    if Variable SILENT Equals TRUE
      if Variable COMMANDLINE Contains (Ignore Case) PASSWORD=
        Set Variable MYPASSWORD to 
        Parse String $COMMANDLINE$ into Variables  and WORD (Split at first occurrence of pattern)
        Parse String $WORD$ into Variables MYPASSWORD and  (Split at first occurrence of pattern)
        Set Persistent Variable PSSWORD to $MYPASSWORD$
      end
    end
    Comment: Install Service D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\PSS\PrintShop Server.exe to $TARGETDIR$\PrintShop Mail Web\PrintShop Server\ as PrintShopServer
  end
end
Comment: end
[DEFINE WEB MEDIA Apache]
Get Component PSMSuite 7\PrintShop Mail Web\Apache Selection State into Variable SELECTED
if Variable PSW Equals TRUE
  if Variable REMOVE Equals FALSE
    Set Variable APACHEFOUND to 
    Set Variable INSTALLAPACHE to TRUE
    Set Variable INSTALLANYWAY to 
    Check Service State for Apache2 (write result into variable APACHEFOUND)
    if Variable APACHEFOUND Equals TRUE
      MessageBox: Apache already installed, A version of Apache was found running. Do you want to install the version that comes with $TITLE$?
      if Variable INSTALLANYWAY Equals NO
        Set Variable INSTALLAPACHE to FALSE
      end
    end
    if Variable INSTALLAPACHE Equals TRUE
      Comment: Delete httpd.conf file to avoid the double configuration of the file
      Comment: Recursively Delete Files 
      Delete Files $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf (when installing)
      Comment: httpconf file back up actions
      Set Variable HTTPDFOUND to 
      Does File Exist $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf.bak (get result into variable HTTPDFOUND)
      if Variable HTTPDFOUND Equals TRUE
        Run Program $WINDIR$system32\cmd.exe /c DEL $QUOTE$$OLDPSWPATH$Apache\conf\httpd.conf.bak$QUOTE$   (WAIT)
      end
      Set Variable SSLFOUND to 
      Does File Exist $TARGETDIR$\PrintShop Mail Web\Apache\conf\ssl.conf.bak (get result into variable SSLFOUND)
      if Variable SSLFOUND Equals TRUE
        Run Program $WINDIR$system32\cmd.exe /c DEL $QUOTE$$OLDPSWPATH$Apache\conf\ssl.conf.bak$QUOTE$   (WAIT)
      end
      Set Variable PHPFOUND to 
      Does File Exist $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini.bak (get result into variable PHPFOUND)
      if Variable PHPFOUND Equals TRUE
        Run Program $WINDIR$system32\cmd.exe /c DEL $QUOTE$$OLDPSWPATH$Apache\PHP\php.ini.bak$QUOTE$   (WAIT)
      end
      Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\Apache\*.* to $TARGETDIR$\PrintShop Mail Web\Apache, ignore files matching wildcard pattern(s) Apache.exe;*svn;*entries*;Repository;Root, include subfolders
      Create Folder $TARGETDIR$\PrintShop Mail Web\Apache\session
      Create Folder $TARGETDIR$\PrintShop Mail Web\Apache\tmp
      Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\Apache\certificate\psw.crt to $TARGETDIR$\PrintShop Mail Web\Apache\certificate, ignore files matching wildcard pattern(s) *svn;*entries*;Repository;Root, include subfolders
      Create Folder $TARGETDIR$\PrintShop Mail Web\Apache\Logs
      Comment: Create the backup Files
      Set Variable MyPath to $TARGETDIR$\PrintShop Mail Web
      Replace \ with / in variable MyPath
      Replace // with / in variable MyPath
      if Variable PSW Equals TRUE
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [PHP] include_path="$MyPath$/Apache/PHP/PEAR"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [PHP] extension_dir="$MyPath$/Apache/PHP/ext"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [PHP] upload_tmp_dir="$MyPath$/Apache/tmp"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [PHP] session.save_path= "$MyPath$/Apache/session"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [PHP] error_log= "$MyPath$/Apache/logs/php.log"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [Session] session.save_path="$MyPath$/Apache/session"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [Zend] zend_extension_manager.optimizer_ts="$TARGETDIR$\PrintShop Mail Web\Apache\zend\optimizer"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [Zend] zend_extension_ts= "$TARGETDIR$\PrintShop Mail Web\Apache\zend\ZendExtensionManager.dll"
        Edit INI File $TARGETDIR$\PrintShop Mail Web\Apache\PHP\php.ini, [Zend] zend_optimizer.optimization_level=15
        Comment: Install Service D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\Apache\bin\Apache.exe to $TARGETDIR$\PrintShop Mail Web\Apache\bin as Apache2
      end
    end
  end
end
[DEFINE WEB MEDIA MYSQL]
if Variable PSW Equals TRUE
  if Variable REMOVE Equals FALSE
    Get Component PSMSuite 7\PrintShop Mail Web\MYSQL Selection State into Variable SELECTED
    Get Required Space by Component PSMSuite 7\PrintShop Mail Web\MYSQL into variable SELECTED
    Set Variable MYSQLFOUND to 
    Set Variable INSTALLMYSQL to TRUE
    Set Variable INSTALLANYWAY to 
    Check Service State for MySQL (write result into variable MYSQLFOUND)
    if Variable MYSQLFOUND Equals TRUE
      MessageBox: MySQL already installed, A version of MySQL was found running. Do you want to install the version that comes with $TITLE$?
      if Variable INSTALLANYWAY Equals NO
        Set Variable INSTALLMYSQL to FALSE
      end
    end
    if Variable INSTALLMYSQL Equals TRUE
      Comment: Install Files D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\MySQL\*.* to $TARGETDIR$\PrintShop Mail Web\MySQL (Shared), ignore files matching wildcard pattern(s) *svn;*entries*;Repository;Root;*., include subfolders
      Set Variable MyPath to $TARGETDIR$\PrintShop Mail Web\MySQL
      Replace \ with / in variable MyPath
      Replace // with / in variable MyPath
      Set Variable RESULTCOPY to 
      Set Variable RESULTCOPY1 to 
      Edit INI File $TARGETDIR$\PrintShop Mail Web\Website\system.ini, [psw] mysql.path="$TARGETDIR$\PrintShop Mail Web\MySQL\bin"
      Edit INI File $TARGETDIR$\PrintShop Mail Web\MySQL\my.ini, [mysqld] basedir="$MyPath$"
      Edit INI File $TARGETDIR$\PrintShop Mail Web\MySQL\my.ini, [mysqld] datadir="$MyPath$/data"
      Comment: Install Service D:\Develop\Internal\PrintShopWeb\Setup\Sourcefiles\MySQL\bin\mysqld.exe to $TARGETDIR$\PrintShop Mail Web\MySQL\bin as MySQL
    end
  end
end
[compiler if Variable BUILDMODE Equals PATCH]
Apply Patch (get result into variable SUCCESS)
[compiler else]
if Variable ADVERTISE Equals TRUE
  Apply Advertised (get result into variable SUCCESS)
else
  Get Folder Location Start Menu->Start Menu Group into SHORTCUTROOT
  Comment: Set Environment Variable %Path% to $TARGETDIR$\PrintShop Mail Web\MYSQL\bin;
  if Variable PSW Equals TRUE
    if Variable REMOVE Equals FALSE
      Edit INI File $DESKTOPDIR$\PrintShop Mail Web.url, [InternetShortcut] IconFile=$TARGETDIR$\PrintShop Mail Web\Website\PSW.ico
      Edit INI File $DESKTOPDIR$\PrintShop Mail Web.url, [InternetShortcut] IconIndex=0
      Edit INI File $DESKTOPDIR$\PrintShop Mail Web.url, [InternetShortcut] Password=administrator
      Edit INI File $DESKTOPDIR$\PrintShop Mail Web.url, [InternetShortcut] URL=http://localhost:$HTTPORTVALUE$
      Edit INI File $DESKTOPDIR$\PrintShop Mail Web.url, [InternetShortcut] Username=administrator
      Comment: create a shortcut in shortcutfolder
      Edit INI File $SHORTCUTFOLDER$\PrintShop Mail Web.url, [InternetShortcut] IconFile=$TARGETDIR$\PrintShop Mail Web\Website\PSW.ico
      Edit INI File $SHORTCUTFOLDER$\PrintShop Mail Web.url, [InternetShortcut] IconIndex=0
      Edit INI File $SHORTCUTFOLDER$\PrintShop Mail Web.url, [InternetShortcut] Password=administrator
      Edit INI File $SHORTCUTFOLDER$\PrintShop Mail Web.url, [InternetShortcut] URL=http://localhost:$HTTPORTVALUE$
      Edit INI File $SHORTCUTFOLDER$\PrintShop Mail Web.url, [InternetShortcut] Username=administrator
    end
  else
    Recursively Delete Files $DESKTOPDIR$PrintShop Mail Web.url
    Replace \\ with \ in variable SHORTCUTFOLDER
    Recursively Delete Files $SHORTCUTFOLDER$\PrintShop Mail Web Services Manager
  end
  Apply Install (get result into variable SUCCESS)
  Set Variable PLUGINRESULT to 
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\CoatedFOGRA27.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\CoatedFOGRA39.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\CoatedGRACoL2006.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\JapanColor2001Coated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\JapanColor2001Uncoated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\JapanColor2002Newspaper.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\JapanColor2003WebCoated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\JapanWebCoated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\UncoatedFOGRA29.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\USSheetfedCoated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\USSheetfedUncoated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\USWebCoatedSWOP.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\USWebUncoated.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\WebCoatedFOGRA28.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\WebCoatedSWOP2006Grade3.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\WebCoatedSWOP2006Grade5.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\AdobeRGB1998.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\AppleRGB.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\ColorMatchRGB.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\PAL_SECAM.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\SMPTE-C.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\VideoHD.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\VideoNTSC.icc" and get result into variable "PLUGINRESULT"
  Install Color Profile Plug-In : installs the profile "$TEMPDIR$\VideoPAL.icc" and get result into variable "PLUGINRESULT"
  Comment: Create data\psw directory when old data\psw is found
  Create Folder $TARGETDIR$\PrintShop Mail Web\MySQL\data\psw
  Comment: Get the feature states
  Set Persistent Variable PSWFEATURE to $PSW$
  Set Persistent Variable BPLUGINFEATURE to $BARCOD$
  Set Persistent Variable DSMPLUGINFEATURE to $DSM$
  Set Persistent Variable OPLUGINFEATURE to $OLAP$
  Comment: Get the Credentials for the repair mode
  Set Persistent Variable PSSUSER to $PSSUSER$
  Set Persistent Variable PSSWORD to $PSSWORD$
  Set Persistent Variable PSSDOMAIN to $PSSDOMAIN$
  Comment: try regserver
  Comment: Theses actions should be done after apply install to complete PSM installation
  Comment: This action complete PSM installation
  if Variable PSM Equals TRUE
    Set Variable ALREADYINSTALL to 
    if Variable REMOVE Equals FALSE
      Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail\InstallPath into PSMINSTALLPATH
      Run Program $PSMINSTALLPATH$haspdinst.exe -i -cm -nomsg (WAIT, get result into variable sqlresult)
      Comment: Added /language to write the language registry key
      Run Program $PSMINSTALLPATH$PSMail.exe  /RegServer /language $SELECTEDLANGUAGE$ (WAIT, get result into variable REGSERVERVALUE)
      Set Persistent Variable MYLANGUAGE to $SELECTEDLANGUAGE$
      Set Variable REGISTERRESULT to 
      Set Variable REGSVRRESULT to 
      Comment: Registered PrintShop Mail ThumbnailViewer.dll
      if Variable X64DETECTED Equals TRUE
        Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
        Register Library D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewerx64.dll (get result into variable REGISTERRESULT)
        if Variable REGISTERRESULT Equals FALSE
          Run Program $WINDIR$system32\regsvr32.exe /s $QUOTE$$PSMINSTALLPATH$Libraries\PrintShop Mail ThumbnailViewerx64.dll$QUOTE$  (WAIT, get result into variable REGSVRRESULT)
          Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
        end
      else
        Register Library D:\Develop\Internal\PrintShopMail\Setup\PrintShop Mail\Sourcefiles\Libraries\PrintShop Mail ThumbnailViewer.dll (get result into variable REGISTERRESULT)
        if Variable REGISTERRESULT Equals FALSE
          Run Program $WINDIR$system32\regsvr32.exe /s $QUOTE$$PSMINSTALLPATH$Libraries\PrintShop Mail ThumbnailViewer.dll$QUOTE$  (WAIT, get result into variable REGSVRRESULT)
        end
      end
    end
    Comment: end
  end
  Comment: Get the system or machine date information
  if Variable PSW Equals TRUE
    Set Variable DLLFUNCTION to 
    Set Variable REMOVEEXCEDENTSLASH to  $TARGETDIR$\PrintShop Mail Web\
    Replace \\ with \ in variable REMOVEEXCEDENTSLASH
    Comment: Action to do;
    Set Variable apacheresult to 
    Set Variable sqlresult to 
    if Variable HTTPSCHECKBOXVALUE Equals TRUE
      Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value LoadModule ssl_module modules/mod_ssl.so (at start of file)
    end
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value </VirtualHost> (at start of file)
    Set Variable DocRootPath to $TARGETDIR$\PrintShop Mail Web\Website
    Replace \\ with \ in variable DocRootPath
    Set Variable ApachePath to $TARGETDIR$\PrintShop Mail Web\Apache
    Replace \\ with \ in variable ApachePath
    Replace \ with / in variable ApachePath
    if Variable HTTPORTVALUE Equals 
      Set Variable HTTPORTVALUE to 80
    end
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value DocumentRoot "$DocRootPath$" (at start of file)
    if Variable HTTPSCHECKBOXVALUE Equals TRUE
      if Variable BINDCHECKBOX Equals TRUE
        Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value <VirtualHost 127.0.0.1:$HTTPORTVALUE$> (at start of file)
      else
        Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value <VirtualHost *:$HTTPORTVALUE$> (at start of file)
      end
    else
      Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value <VirtualHost *:$HTTPORTVALUE$> (at start of file)
    end
    Comment: Copy the backup files
    Comment: Write into the config files all the configuration lines
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value Listen $HTTPORTVALUE$ (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value # (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value ServerRoot "$ApachePath$" (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value LoadModule php5_module "PHP/php5apache2.dll" (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value PHPIniDir "$ApachePath$/PHP"  (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value # (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value # PSW Configuration (at start of file)
    Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\httpd.conf from Value # (at start of file)
    Set Variable OSBit to 
    Comment: Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\ssl.conf from Value ServerName localhost (at start of file)
    if Variable HTTPSCHECKBOXVALUE Equals TRUE
      Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\ssl.conf from Value DocumentRoot "$DocRootPath$" (at start of file)
      Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\ssl.conf from Value <VirtualHost *:$APACHEHTTPSPORTNUMBER$> (at start of file)
      Write into Text File $TARGETDIR$\PrintShop Mail Web\Apache\conf\ssl.conf from Value Listen $APACHEHTTPSPORTNUMBER$ (at start of file)
    end
    Get System Setting Windows in 64 bit Mode into OSBit
    Set Variable REMOVEEXCEDENTSLASH to  $TARGETDIR$\PrintShop Mail Web\
    Replace \\ with \ in variable REMOVEEXCEDENTSLASH
    Comment: Check if the installer already did the printer installation and avoid to do it again
    Set Variable WEBSITEFOUND to 
    Set Variable MYSQLDATAFOLDERFOUND to 
    Does Folder Exist $OLDPSWPATH$Website\ (get result into variable WEBSITEFOUND)
    Does Folder Exist $OLDPSWPATH$MYSQL\data (get result into variable MYSQLDATAFOLDERFOUND)
    Comment: Create backup files
    Set Variable PSWINSTALLPATH to 
    Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail Web\InstallPath into PSWINSTALLPATH
    Set Variable QUOTE to "
    Set Variable SRCHTTP to $PSWINSTALLPATH$Apache\conf\httpd.conf
    Set Variable TARGETHTTP to $PSWINSTALLPATH$Apache\conf\httpd.conf.$DAY$-$MONTH$-$YEAR$
    Set Variable QUOTE to "
    Set Variable PSWINSTALLPATH to 
    Read Registry Key HKLM\Software\Objectif Lune\PrintShop Mail Suite 7\PrintShop Mail Web\InstallPath into PSWINSTALLPATH
    Read from Text File $TEMPDIR$\PSWBACKUPPATH.txt into Variable OLDPSWPATH
    Comment: Set Variable MYSOURCEPATH to $OLDPSWPATH$MySQL\data\psw
    Set Variable MYSOURCEPATH to $OLDPSWPATH$MySQL\data
    Set Variable MYDESTINATIONPATH to $PSWINSTALLPATH$MySQL\data
    Set Variable MYDESTINATIONPATHMYSQL to $PSWINSTALLPATH$MySQL\data\mysql
    Set Variable MYCLEANDESTINATIONPATH to $PSWINSTALLPATH$MySQL\clean_data
    Set Variable MYCLEANDESTINATIONPATHCLEAN to $PSWINSTALLPATH$MySQL\clean_data\mysql
    Set Variable MYSOURCEPATH2 to $OLDPSWPATH$Website\files
    Set Variable MYDESTINATIONPATH2 to $PSWINSTALLPATH$Website\files
    if Variable X64DETECTED Equals TRUE
      Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
    end
    Comment: Stop the services before the files copy
    Comment: a copy of templates folder
    Set Variable SSLCOPY to 
    Set Variable REMOVEEXCEDENTSLASH to $TARGETDIR$\PrintShop Mail Web\
    Replace \\ with \ in variable REMOVEEXCEDENTSLASH
    Set Variable TEMPLATEFOLDEREXIST to 
    Does Folder Exist $OLDPSWPATH$Website\templates (get result into variable TEMPLATEFOLDEREXIST)
    if Variable TEMPLATEFOLDEREXIST Equals TRUE
      Run Program $WINDIR$System32\cmd.exe /c xcopy $QUOTE$$OLDPSWPATH$Website\templates\*.*$QUOTE$   $QUOTE$$REMOVEEXCEDENTSLASH$Website\templates\$QUOTE$ /E /Y  (WAIT, get result into variable SSLCOPY)
    end
    Comment: do a clean copy of data folder
    Run Program $WINDIR$system32\xcopy.exe $QUOTE$$MYDESTINATIONPATH$$QUOTE$   $QUOTE$$MYCLEANDESTINATIONPATH$$QUOTE$  /I /S /Y (WAIT, get result into variable RESULTCOPY1)
    Comment: copy old data to the new install folder location
    Run Program $WINDIR$system32\xcopy.exe $QUOTE$$OLDPSWPATH$MySQL\data$QUOTE$   $QUOTE$$MYDESTINATIONPATH$$QUOTE$ /I /S /Y (WAIT, get result into variable RESULTCOPY1)
    Comment: copy again mysql folder from clean folder to current folder
    Run Program $WINDIR$system32\xcopy.exe $QUOTE$$PSWINSTALLPATH$MySQL\clean_data\mysql$QUOTE$   $QUOTE$$PSWINSTALLPATH$MySQL\data\mysql$QUOTE$   /Y (WAIT, get result into variable RESULTCOPY1)
    Comment: COPY files repository into website
    Run Program $WINDIR$system32\xcopy.exe $QUOTE$$MYSOURCEPATH2$$QUOTE$   $QUOTE$$MYDESTINATIONPATH2$$QUOTE$ /I /E /Y (WAIT, get result into variable RESULTCOPY1)
    Comment: Delete the old files folder from PSW 2.x.x repository
    Run Program $WINDIR$system32\cmd.exe /c rmdir $QUOTE$$MYSOURCEPATH2$$QUOTE$ /S /Q (WAIT)
    Run Program $WINSYSDIR$cmd.exe /c rmdir /S /Q  $QUOTE$$PSWINSTALLPATH$MySQL\clean_data$QUOTE$ (WAIT)
    Run Program $WINSYSDIR$cmd.exe /c DEL  $QUOTE$$TEMPDIR$\PSWBACKUPPATH.txt$QUOTE$ /S /Q (WAIT)
    Comment: Delete all icc files in temp folder
    Run Program $WINSYSDIR$cmd.exe /c DEL  $QUOTE$$TEMPDIR$\*.icc$QUOTE$ /S /Q (WAIT)
    Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
    Comment: for the x64 case only copy the files located in drive to system32
    Comment: Remove the temporary registry entry which contains the old PSW path 
    Comment: Delete Registry KEY HKLM\Software\Tmp\*.*
    Comment: Register the PSMail COM api
    Run Program $WINSYSDIR$net.exe start Apache2 (WAIT)
    Run Program $WINSYSDIR$net.exe start MySQL (WAIT)
  end
end
 
Comment: Catch the cancel button and removed all files already installed
if Variable SUCCESS Equals CANCEL
  Set Variable PROGRESSTEXT to Proceed to a rollback and removed useless files
  Set Variable REMOVE to TRUE
end
Comment: Install the Printer DRIVER
Set Variable PSMINSTALLPATH to 
Set Variable PRINTEREXIST to 
Comment: Read Registry Key HKLM\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\PrintShop Mail Printer\Name into PRINTEREXIST
if Variable X64DETECTED Equals TRUE
  Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\PrintShop Mail Printer\Name into PRINTEREXIST
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
else
  Check Registry Key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\PrintShop Mail Printer\Name into PRINTEREXIST
end
if Variable REMOVE Equals FALSE
  Set Variable RUNAPP to TRUE
  Set Variable PROJECTFODLEREXIST to 
  Set Variable PSMLOCATIONPATH to $TARGETDIR$\PrintShop Mail
  Replace \\ with \ in variable PSMLOCATIONPATH
  Does Folder Exist $PSMLOCATIONPATH$ (get result into variable PROJECTFODLEREXIST)
  Comment: To avoid the installation to continue when an error occure during installation process failed
  if Variable PROJECTFODLEREXIST Equals TRUE
    if Variable PRINTEREXIST Equals NO$KEY
      Set Variable PROGRESSTEXT to Installing the Printer Driver
      if Variable X64DETECTED Equals TRUE
        Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
      end
      Set Variable WINDOWSVERNB to 
      Check Registry Key HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion into WINDOWSVERNB
      if Variable WINDOWSVERNB Greater Than 5.2
        Run Program $WINDIR$system32\rundll32.exe  printui.dll,PrintUIEntry /if /b "PrintShop Mail Printer" /f $TEMPDIR$PSMSUITE7DRIVER\psmps.inf /r "lpt1:" /m "PrintShop Mail Printer Driver (PS)" (WAIT)
      else
        Run Program $WINDIR$system32\rundll32.exe  printui.dll,PrintUIEntry /if /b "PrintShop Mail Printer" /f $WINDIR$inf/Printers/psmps.inf /r "lpt1:" /m "PrintShop Mail Printer Driver (PS)" (WAIT)
      end
      Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
    end
    Comment: Get the full installer and put it in the uncompress folder where the msi is hidden
    Set Variable MYSETUPSOURCE to $SFXPATH$$SFXFILE$
    Set Variable RESULTCOPY1 to 
    Run Program $WINSYSDIR$xcopy.exe $QUOTE$$MYSETUPSOURCE$$QUOTE$   $QUOTE$$ENGINECACHE$PSMSuite7.exe$QUOTE$  /Y (WAIT, get result into variable RESULTCOPY1)
  end
  Comment: Start the services PS Service here to refresh the Publish to Web cache
  Run Program $WINSYSDIR$net.exe start PrintShopServer (WAIT)
  Comment: Write the HTTP port number for the PSS server url
  Run Program $WINDIR$System32\REG.exe ADD $QUOTE$HKEY_LOCAL_MACHINE\Software\Objectif Lune\$TITLE$\PrintShop Server\7.0\Settings$QUOTE$ /v $QUOTE$PrintShop Web URL$QUOTE$ /t REG_SZ /d $QUOTE$http://127.0.0.1:$HTTPORTVALUE$$QUOTE$ /f (WAIT, get result into variable SELEC)
end
Comment: This action check if PSW was install first and during maintenance mode PSW checkbox is unchecked
Set Variable ALREADYINSTALL to 
Set Variable PSWEXIST to 
Get Installed State for $PRODUCTCODE$ into Variable ALREADYINSTALL
Does Folder Exist $TARGETDIR$\PrintShop Mail Web (get result into variable PSWEXIST)
if Variable ALREADYINSTALL Equals TRUE
  if Variable PSWEXIST Equals TRUE
    if Variable PSW Equals FALSE
      if Variable REPAIR Equals TRUE
        Run Program $WINSYSDIR$sc.exe stop Apache2 (WAIT)
        Run Program $WINSYSDIR$sc.exe delete Apache2 (WAIT)
        Run Program $WINSYSDIR$sc.exe stop MySQL (WAIT)
        Run Program $WINSYSDIR$sc.exe delete MySQL (WAIT)
        Run Program $WINSYSDIR$sc.exe stop PrintShopServer (WAIT)
        Run Program $WINSYSDIR$sc.exe delete PrintShopServer (WAIT)
        Recursively Delete Files $TARGETDIR$\PrintShop Mail Web\*
        Recursively Delete Files $DESKTOPDIR$PrintShop Mail Web.url
      end
    end
  end
end
if Variable REMOVE Equals TRUE
  if Variable X64DETECTED Equals TRUE
    Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
  end
  Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
  Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$$QUOTE$ /f (WAIT, get result into variable VALREG)
  Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_CLASSES_ROOT\Installer\Products\$SECRETPRODUCTCODE$$QUOTE$ /f (WAIT)
  Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\$SECRETPRODUCTCODE$$QUOTE$ /f (WAIT)
  Comment: Delete file extension association
  Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.PSMD$QUOTE$ /f (WAIT, get result into variable PSMDVAL)
  Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.PSMT$QUOTE$ /f (WAIT, get result into variable PSMTVAL)
end
[compiler end]
Set Variable PROGRESS to 100
Comment: Write the language key for the launch of PSMail in the installation language
Comment: Set Variable LANGUEREGISTRY to HKEY_CURRENT_USER\Software\PrintShop Mail\PrintShop Mail 7.0\Settings
Comment: if Variable REMOVE Equals FALSE
Comment: Run Program $WINDIR$System32\REG.exe ADD $QUOTE$$LANGUEREGISTRY$$QUOTE$ /v $QUOTE$Language$QUOTE$ /t REG_SZ /d $QUOTE$$SELECTEDLANGUAGE$$QUOTE$ /f (WAIT, get result into variable SELEC)
Comment: end
[END REGION]
[END REGION]
 
[DEFINE REGION: Finish Setup]
Comment: End of Installation
Hide Dialog
Display Dialog: finish, wait for dialog to return (modal)
Comment: IF checkbox check for update is checked
if Variable SILENT Equals FALSE
  if Variable RUNAPP Equals TRUE
    Comment: if Variable ALREADYINSTALL Equals FALSE
    Run Program $COMMONFILES$Objectif Lune\Update Client\UpdateClient.exe 
    Comment: end
  end
  if Variable REMOVE Equals TRUE
    Comment: Delete registry entries for the Control Panel
    Set Variable REGEXIST to 
    Set Variable REGCLASSES to 
    if Variable X64DETECTED Equals TRUE
      Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
    end
    Check Registry Key HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$\ into REGEXIST
    Check Registry Key HKCR\Installer\Products\$SECRETPRODUCTCODE$\ into REGCLASSES
    Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$MYDELETEPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$MYTITLEPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$MYARPPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$MYARPPRODUCTCODEPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$UNKNOWKEYPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$UNKNOWCLASSROOTPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$LASTKEYPATH$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$DELETEPSSKEY$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$$QUOTE$ /f (WAIT, get result into variable VALREG)
    Run Program $WINDIR$System32\REG.exe ADD/v KEY /t REG_SZ /d "REG DELETE $QUOTE$HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$SECRETPRODUCTCODE$$QUOTE$ /f" (WAIT, get result into variable TOP)
    if Variable X64DETECTED Equals TRUE
      Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$MYDELETEPATHX64$$QUOTE$ /f (WAIT, get result into variable VALREG)
      Run Program $WINDIR$System32\REG.exe DELETE $QUOTE$$MYTITLEPATHX64$$QUOTE$ /f (WAIT, get result into variable VALREG)
    end
    Set Win32 - Native 32 bit Windows and Windows 32 on Windows 64 (WOW64) - installation mode
    MessageBox: $TITLE$ Setup, Your computer needs to be restarted .$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. $NEWLINE$If you click CANCEL, setup will exit. 
    if Variable REBOOTNOW Equals OK
      Reboot Computer
    end
  end
  if Variable REBOOTCOMPUTER Equals TRUE
    if Variable SUCCESS Equals REBOOT
      Reboot Computer
    end
  end
   
end
[END REGION]
 
